|
|
@ -273,16 +273,25 @@ class HTTPError(BuildError):
|
|
|
|
class PythonBuilder(object):
|
|
|
|
class PythonBuilder(object):
|
|
|
|
def __init__(self, **kwargs):
|
|
|
|
def __init__(self, **kwargs):
|
|
|
|
python_version = kwargs.pop('python', '3.4')
|
|
|
|
python_version = kwargs.pop('python', '3.4')
|
|
|
|
|
|
|
|
python_path = None
|
|
|
|
|
|
|
|
for node in ('Wow6432Node\\', ''):
|
|
|
|
try:
|
|
|
|
try:
|
|
|
|
key = compat_winreg.OpenKey(
|
|
|
|
key = compat_winreg.OpenKey(
|
|
|
|
compat_winreg.HKEY_LOCAL_MACHINE, r'SOFTWARE\Python\PythonCore\%s\InstallPath' % python_version)
|
|
|
|
compat_winreg.HKEY_LOCAL_MACHINE,
|
|
|
|
|
|
|
|
r'SOFTWARE\%sPython\PythonCore\%s\InstallPath' % (node, python_version))
|
|
|
|
try:
|
|
|
|
try:
|
|
|
|
self.pythonPath, _ = compat_winreg.QueryValueEx(key, '')
|
|
|
|
python_path, _ = compat_winreg.QueryValueEx(key, '')
|
|
|
|
finally:
|
|
|
|
finally:
|
|
|
|
compat_winreg.CloseKey(key)
|
|
|
|
compat_winreg.CloseKey(key)
|
|
|
|
|
|
|
|
break
|
|
|
|
except Exception:
|
|
|
|
except Exception:
|
|
|
|
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if not python_path:
|
|
|
|
raise BuildError('No such Python version: %s' % python_version)
|
|
|
|
raise BuildError('No such Python version: %s' % python_version)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
self.pythonPath = python_path
|
|
|
|
|
|
|
|
|
|
|
|
super(PythonBuilder, self).__init__(**kwargs)
|
|
|
|
super(PythonBuilder, self).__init__(**kwargs)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|