From cab5e8f089a3d3ade44d04ecef2af40f69f43af7 Mon Sep 17 00:00:00 2001 From: Dustin Rodrigues Date: Tue, 26 Jan 2021 00:49:34 -0500 Subject: [PATCH] show error message when trying to install pip 21+ on python 2 --- get-pip.py | 5 +++-- templates/default.py | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/get-pip.py b/get-pip.py index 78643a49..60ac91fc 100755 --- a/get-pip.py +++ b/get-pip.py @@ -34,8 +34,9 @@ if PY3: iterbytes = iter else: - def iterbytes(buf): - return (ord(byte) for byte in buf) + print("Python 2 is not supported with this version of get-pip.py. " + "Please use https://bootstrap.pypa.io/2.7/get-pip.py") + sys.exit(1) try: from base64 import b85decode diff --git a/templates/default.py b/templates/default.py index a3dd0d47..f9ae8a91 100644 --- a/templates/default.py +++ b/templates/default.py @@ -34,8 +34,9 @@ if PY3: iterbytes = iter else: - def iterbytes(buf): - return (ord(byte) for byte in buf) + print("Python 2 is not supported with this version of get-pip.py. " + "Please use https://bootstrap.pypa.io/2.7/get-pip.py") + sys.exit(1) try: from base64 import b85decode