fix get_system_environment misses if same python version has multiple installs

The Environment.__init__ may throw an InvalidPythonEnvironment if the call to _get_subprocess() fails. In this case other registered Python environments of the same Python version may still work and shall also be considered.
This commit is contained in:
mlangkabel
2019-02-12 14:14:11 +01:00
committed by Dave Halter
parent 24a06d2bf9
commit c801e24afc

View File

@@ -333,7 +333,10 @@ def get_system_environment(version):
if os.name == 'nt':
for exe in _get_executables_from_windows_registry(version):
return Environment(exe)
try:
return Environment(exe)
except InvalidPythonEnvironment:
pass
raise InvalidPythonEnvironment("Cannot find executable python%s." % version)