mirror of
https://github.com/wakatime/sublime-wakatime.git
synced 2023-08-10 21:13:02 +03:00
handle case where Sublime Text does not have winreg builtin module
This commit is contained in:
parent
4be40c7720
commit
6985ce32bb
@ -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:
|
||||||
|
Loading…
Reference in New Issue
Block a user