Skip to content

Commit ea1319d

Browse files
authored
Merge pull request #5233 from pradyunsg/fix/5219
Make the Windows "self-modification" check more strict
2 parents 5ea5c4d + 2a085b3 commit ea1319d

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

news/5219.bugfix

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix a bug that made get-pip.py unusable on Windows without renaming.

src/pip/_internal/basecommand.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -335,8 +335,8 @@ def populate_requirement_set(requirement_set, args, options, finder,
335335
# See https://github.com/pypa/pip/issues/1299 for more discussion
336336
should_show_use_python_msg = (
337337
WINDOWS and
338-
requirement_set.has_requirement('pip') and
339-
"pip" in os.path.basename(sys.argv[0])
338+
requirement_set.has_requirement("pip") and
339+
os.path.basename(sys.argv[0]).startswith("pip")
340340
)
341341
if should_show_use_python_msg:
342342
new_command = [

0 commit comments

Comments
 (0)