summaryrefslogtreecommitdiff
path: root/pkg_resources
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2020-05-24 16:06:38 -0400
committerJason R. Coombs <jaraco@jaraco.com>2020-05-24 16:06:52 -0400
commit64b1a6fa12f7d4f6508008541adbebdcd6ee20a8 (patch)
treec1ba5043e8dcbc86e3a1a8b87cf88f0b8594a198 /pkg_resources
parent46dab46d6debf69331b646bff11052dc731d4ae4 (diff)
downloadpython-setuptools-git-64b1a6fa12f7d4f6508008541adbebdcd6ee20a8.tar.gz
Force fail on Python 2. When doing so, emit an error that directs users to the latest guidance. Fixes #2094.
Diffstat (limited to 'pkg_resources')
-rw-r--r--pkg_resources/py2_warn.py19
1 files changed, 7 insertions, 12 deletions
diff --git a/pkg_resources/py2_warn.py b/pkg_resources/py2_warn.py
index bfc35234..00cc8bc7 100644
--- a/pkg_resources/py2_warn.py
+++ b/pkg_resources/py2_warn.py
@@ -4,18 +4,13 @@ import textwrap
msg = textwrap.dedent("""
- You are running Setuptools on Python 2, which is no longer
- supported and
- >>> SETUPTOOLS WILL STOP WORKING <<<
- in a subsequent release (no sooner than 2020-04-20).
- Please ensure you are installing
- Setuptools using pip 9.x or later or pin to `setuptools<45`
- in your environment.
- If you have done those things and are still encountering
- this message, please follow up at
- https://bit.ly/setuptools-py2-warning.
+ Encountered a version of Setuptools that no longer supports
+ this version of Python. Please head to
+ https://bit.ly/setuptools-py2-warning for support.
""")
-pre = "Setuptools will stop working on Python 2\n"
+pre = "Setuptools no longer works on Python 2\n"
-sys.version_info < (3,) and warnings.warn(pre + "*" * 60 + msg + "*" * 60)
+if sys.version_info < (3,):
+ warnings.warn(pre + "*" * 60 + msg + "*" * 60)
+ raise SystemExit(32)