1
0
forked from VimPlug/jedi

Add a windows path in _get_executable_path()

This commit is contained in:
HairlessVillager
2024-05-06 17:04:38 +08:00
committed by GitHub
parent a4574a50d0
commit 8792c6d432

View File

@@ -373,10 +373,13 @@ def _get_executable_path(path, safe=True):
""" """
if os.name == 'nt': if os.name == 'nt':
python = os.path.join(path, 'Scripts', 'python.exe') pythons = [os.path.join(path, 'Scripts', 'python.exe'), os.path.join(path, 'python.exe')]
else:
pythons = [os.path.join(path, 'bin', 'python')]
for python in pythons:
if os.path.exists(python):
break
else: else:
python = os.path.join(path, 'bin', 'python')
if not os.path.exists(python):
raise InvalidPythonEnvironment("%s seems to be missing." % python) raise InvalidPythonEnvironment("%s seems to be missing." % python)
_assert_safe(python, safe) _assert_safe(python, safe)