Skip to content

Commit 77c989f

Browse files
committed
Only show Python 2.7 EOL date on CPython.
Other Python implementations, notably PyPy, are not EOL'ing on January 1, 2020.
1 parent e5f4bbb commit 77c989f

File tree

2 files changed

+12
-7
lines changed

2 files changed

+12
-7
lines changed

news/6207.bugfix

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
The Python 2 end of life warning now only shows on CPython, which is the
2+
implementation that has announced end of life plans.

src/pip/_internal/cli/base_command.py

+10-7
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import logging.config
66
import optparse
77
import os
8+
import platform
89
import sys
910
import traceback
1011

@@ -145,14 +146,16 @@ def main(self, args):
145146
gone_in='19.2',
146147
)
147148
elif sys.version_info[:2] == (2, 7):
148-
deprecated(
149-
"Python 2.7 will reach the end of its life on January 1st, "
150-
"2020. Please upgrade your Python as Python 2.7 won't be "
151-
"maintained after that date. A future version of pip will "
152-
"drop support for Python 2.7.",
153-
replacement=None,
154-
gone_in=None,
149+
message = (
150+
"A future version of pip will drop support for Python 2.7."
155151
)
152+
if platform.python_implementation() == "CPython":
153+
message = (
154+
"Python 2.7 will reach the end of its life on January "
155+
"1st, 2020. Please upgrade your Python as Python 2.7 "
156+
"won't be maintained after that date. "
157+
) + message
158+
deprecated(message, replacement=None, gone_in=None)
156159

157160
# TODO: Try to get these passing down from the command?
158161
# without resorting to os.environ to hold these.

0 commit comments

Comments
 (0)