Skip to content

Commit

Permalink
Merge pull request #1994 from HairlessVillager/patch-1
Browse files Browse the repository at this point in the history
Add a windows path in `_get_executable_path()`
  • Loading branch information
davidhalter authored May 6, 2024
2 parents a4574a5 + 8792c6d commit f7c9ee9
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 f7c9ee9

Please sign in to comment.