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.
1 parent 299d5be commit 2a061c2Copy full SHA for 2a061c2
src/pip/_internal/utils/misc.py
@@ -878,12 +878,19 @@ def protect_pip_from_modification_on_windows(modifying_pip):
878
On Windows, any operation modifying pip should be run as:
879
python -m pip ...
880
"""
881
+ pip_names = [
882
+ "pip.exe",
883
+ "pip{}.exe".format(sys.version_info[0]),
884
+ "pip{}.{}.exe".format(*sys.version_info[:2])
885
+ ]
886
+
887
# See https://github.com/pypa/pip/issues/1299 for more discussion
888
should_show_use_python_msg = (
889
modifying_pip and
890
WINDOWS and
- os.path.basename(sys.argv[0]).startswith("pip")
891
+ os.path.basename(sys.argv[0]) in pip_names
892
)
893
894
if should_show_use_python_msg:
895
new_command = [
896
sys.executable, "-m", "pip"
0 commit comments