aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorSergey M․ <[email protected]>2016-05-29 10:02:00 +0600
committerSergey M․ <[email protected]>2016-05-29 10:02:00 +0600
commit165e3561e9ec8f8a1a1037e4fdebe880cdbd92fb (patch)
treeae5cfd0399f4d5f8eb5924cc93a10ae07b39e010
parent27f17c0eabde55cbaab613280f60c01f5ee01025 (diff)
downloadyoutube-dl-165e3561e9ec8f8a1a1037e4fdebe880cdbd92fb.tar.gz
youtube-dl-165e3561e9ec8f8a1a1037e4fdebe880cdbd92fb.zip
[devscripts/buildserver] Check Wow6432Node first when searching for python
This allows building releases from 64bit OS
-rw-r--r--devscripts/buildserver.py23
1 files changed, 16 insertions, 7 deletions
diff --git a/devscripts/buildserver.py b/devscripts/buildserver.py
index dada6bfc7..2bd12da50 100644
--- a/devscripts/buildserver.py
+++ b/devscripts/buildserver.py
@@ -273,16 +273,25 @@ class HTTPError(BuildError):
class PythonBuilder(object):
def __init__(self, **kwargs):
python_version = kwargs.pop('python', '3.4')
- try:
- key = compat_winreg.OpenKey(
- compat_winreg.HKEY_LOCAL_MACHINE, r'SOFTWARE\Python\PythonCore\%s\InstallPath' % python_version)
+ python_path = None
+ for node in ('Wow6432Node\\', ''):
try:
- self.pythonPath, _ = compat_winreg.QueryValueEx(key, '')
- finally:
- compat_winreg.CloseKey(key)
- except Exception:
+ key = compat_winreg.OpenKey(
+ compat_winreg.HKEY_LOCAL_MACHINE,
+ r'SOFTWARE\%sPython\PythonCore\%s\InstallPath' % (node, python_version))
+ 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)
+ self.pythonPath = python_path
+
super(PythonBuilder, self).__init__(**kwargs)