Skip to content

Commit efb8bbf

Browse files
committed
fix(python): constrain active python fallback
1 parent 6402de0 commit efb8bbf

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/poetry/utils/env/python/manager.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,9 @@ def get_active_python(cls) -> Python | None:
103103
for python in ShutilWhichPythonProvider().find_pythons():
104104
return cls(python=python)
105105

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

110111
return None

0 commit comments

Comments
 (0)