We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 57c9f62 + 6354192 commit 0930237Copy full SHA for 0930237
news/11309.bugfix.rst
@@ -0,0 +1 @@
1
+Ensure that the candidate ``pip`` executable exists, when checking for a new version of pip.
src/pip/_internal/utils/entrypoints.py
@@ -55,9 +55,14 @@ def get_best_invocation_for_this_pip() -> str:
55
if exe_are_in_PATH:
56
for exe_name in _EXECUTABLE_NAMES:
57
found_executable = shutil.which(exe_name)
58
- if found_executable and os.path.samefile(
59
- found_executable,
60
- os.path.join(binary_prefix, exe_name),
+ binary_executable = os.path.join(binary_prefix, exe_name)
+ if (
+ found_executable
61
+ and os.path.exists(binary_executable)
62
+ and os.path.samefile(
63
+ found_executable,
64
+ binary_executable,
65
+ )
66
):
67
return exe_name
68
0 commit comments