mirror of
https://codeberg.org/polarisfm/youtube-dl
synced 2024-11-22 16:44:32 +01:00
[devscripts/buildserver] Check Wow6432Node first when searching for python
This allows building releases from 64bit OS
This commit is contained in:
parent
27f17c0eab
commit
165e3561e9
@ -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')
|
||||||
try:
|
python_path = None
|
||||||
key = compat_winreg.OpenKey(
|
for node in ('Wow6432Node\\', ''):
|
||||||
compat_winreg.HKEY_LOCAL_MACHINE, r'SOFTWARE\Python\PythonCore\%s\InstallPath' % python_version)
|
|
||||||
try:
|
try:
|
||||||
self.pythonPath, _ = compat_winreg.QueryValueEx(key, '')
|
key = compat_winreg.OpenKey(
|
||||||
finally:
|
compat_winreg.HKEY_LOCAL_MACHINE,
|
||||||
compat_winreg.CloseKey(key)
|
r'SOFTWARE\%sPython\PythonCore\%s\InstallPath' % (node, python_version))
|
||||||
except Exception:
|
try:
|
||||||
|
python_path, _ = compat_winreg.QueryValueEx(key, '')
|
||||||
|
finally:
|
||||||
|
compat_winreg.CloseKey(key)
|
||||||
|
break
|
||||||
|
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)
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user