Skip to content

Commit

Permalink
fix(python): constrain active python fallback
Browse files Browse the repository at this point in the history
  • Loading branch information
abn committed Feb 1, 2025
1 parent 677ca83 commit deb59d9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/poetry/utils/env/python/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,9 @@ def get_active_python(cls) -> Python | None:
for python in ShutilWhichPythonProvider().find_pythons():
return cls(python=python)

# fallback to findpython
if python := findpython.find():
# fallback to findpython, restrict to finding only executables
# named "python" as the intention here is just that, nothing more
if python := findpython.find("python"):
return cls(python=python)

return None
Expand Down

0 comments on commit deb59d9

Please sign in to comment.