summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Lib/ensurepip/__init__.py5
-rw-r--r--Lib/test/test_ensurepip.py6
-rw-r--r--Misc/NEWS10
-rw-r--r--Tools/msi/msi.py2
4 files changed, 18 insertions, 5 deletions
diff --git a/Lib/ensurepip/__init__.py b/Lib/ensurepip/__init__.py
index f584bdc..7cf6a4b 100644
--- a/Lib/ensurepip/__init__.py
+++ b/Lib/ensurepip/__init__.py
@@ -128,9 +128,10 @@ def _uninstall_helper(*, verbosity=0):
# If the pip version doesn't match the bundled one, leave it alone
if pip.__version__ != _PIP_VERSION:
- msg = ("ensurepip will only uninstall a matching pip "
+ msg = ("ensurepip will only uninstall a matching version "
"({!r} installed, {!r} bundled)")
- raise RuntimeError(msg.format(pip.__version__, _PIP_VERSION))
+ print(msg.format(pip.__version__, _PIP_VERSION), file=sys.stderr)
+ return
_require_ssl_for_pip()
_disable_pip_configuration_settings()
diff --git a/Lib/test/test_ensurepip.py b/Lib/test/test_ensurepip.py
index 8644a65..70b4153 100644
--- a/Lib/test/test_ensurepip.py
+++ b/Lib/test/test_ensurepip.py
@@ -196,10 +196,12 @@ class TestUninstall(EnsurepipMixin, unittest.TestCase):
ensurepip._uninstall_helper()
self.run_pip.assert_not_called()
- def test_uninstall_fails_with_wrong_version(self):
+ def test_uninstall_skipped_with_warning_for_wrong_version(self):
with fake_pip("not a valid version"):
- with self.assertRaises(RuntimeError):
+ with test.support.captured_stderr() as stderr:
ensurepip._uninstall_helper()
+ warning = stderr.getvalue().strip()
+ self.assertIn("only uninstall a matching version", warning)
self.run_pip.assert_not_called()
diff --git a/Misc/NEWS b/Misc/NEWS
index 80c8913..c63054a 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -34,6 +34,16 @@ Tests
- Issue #20743: Fix a reference leak in test_tcl.
+Build
+-----
+
+- Issue #20568: The Windows installer now installs the unversioned ``pip``
+ command in addition to the versioned ``pip3`` and ``pip3.4`` commands.
+
+- Issue #20757: The ensurepip helper for the Windows uninstaller now skips
+ uninstalling pip (rather than failing) if the user has updated pip to a
+ different version from the one bundled with ensurepip.
+
Tools/Demos
-----------
diff --git a/Tools/msi/msi.py b/Tools/msi/msi.py
index 8409b81..038050b 100644
--- a/Tools/msi/msi.py
+++ b/Tools/msi/msi.py
@@ -420,7 +420,7 @@ def add_ui(db):
compileargs = r'-Wi "[TARGETDIR]Lib\compileall.py" -f -x "bad_coding|badsyntax|site-packages|py2_|lib2to3\\tests|venv\\scripts" "[TARGETDIR]Lib"'
lib2to3args = r'-c "import lib2to3.pygram, lib2to3.patcomp;lib2to3.patcomp.PatternCompiler()"'
- updatepipargs = r'-m ensurepip -U'
+ updatepipargs = r'-m ensurepip -U --default-install'
removepipargs = r'-m ensurepip._uninstall'
# See "CustomAction Table"
add_data(db, "CustomAction", [