handle case where Sublime Text does not have winreg builtin module

This commit is contained in:
Alan Hamlett 2015-10-01 15:14:36 -07:00
parent 4be40c7720
commit 6985ce32bb

View File

@ -26,7 +26,10 @@ from subprocess import Popen
try: try:
import _winreg as winreg # py2 import _winreg as winreg # py2
except ImportError: except ImportError:
import winreg # py3 try:
import winreg # py3
except ImportError:
winreg = None
# globals # globals
@ -133,7 +136,7 @@ def python_binary():
def find_python_from_registry(location, reg=None): def find_python_from_registry(location, reg=None):
if platform.system() != 'Windows': if platform.system() != 'Windows' or winreg is None:
return None return None
if reg is None: if reg is None: