Skip to content

Commit 4dc35b7

Browse files
committed
Skip the executable check, as subprocess.run will catch this
1 parent 3333891 commit 4dc35b7

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/pip/_internal/cli/main_parser.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,19 +71,18 @@ def identify_python_interpreter(python: str) -> Optional[str]:
7171
if py:
7272
return py
7373

74-
# If the named file exists, and is executable, use it.
74+
# If the named file exists, use it.
7575
# If it's a directory, assume it's a virtual environment and
7676
# look for the environment's Python executable.
7777
if os.path.exists(python):
78-
# Do the directory check first because directories can be executable
7978
if os.path.isdir(python):
8079
# bin/python for Unix, Scripts/python.exe for Windows
8180
# Try both in case of odd cases like cygwin.
8281
for exe in ("bin/python", "Scripts/python.exe"):
8382
py = os.path.join(python, exe)
8483
if os.path.exists(py):
8584
return py
86-
elif os.access(python, os.X_OK):
85+
else:
8786
return python
8887

8988
# Could not find the interpreter specified

0 commit comments

Comments
 (0)