Skip to content

Commit

Permalink
Add a windows path in _get_executable_path()
Browse files Browse the repository at this point in the history
  • Loading branch information
HairlessVillager authored May 6, 2024
1 parent a4574a5 commit 8792c6d
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions jedi/api/environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -373,10 +373,13 @@ def _get_executable_path(path, safe=True):
"""

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:
python = os.path.join(path, 'bin', 'python')
if not os.path.exists(python):
raise InvalidPythonEnvironment("%s seems to be missing." % python)

_assert_safe(python, safe)
Expand Down

0 comments on commit 8792c6d

Please sign in to comment.