Skip to content

Commit 71dbc9c

Browse files
committed
Warn on Python 2.7
1 parent 0637aad commit 71dbc9c

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

news/6148.removal

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Start printing a warning for Python 2.7 to warn of impending Python 2.7 End-of-life and
2+
prompt users to start migrating to Python 3.

src/pip/_internal/cli/base_command.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,14 @@ def main(self, args):
143143
replacement=None,
144144
gone_in='19.2',
145145
)
146+
elif sys.version_info[:2] == (2, 7):
147+
deprecated(
148+
"Python 2.7 will reach the end of it's life on January 1st, 2020. "
149+
"Please upgrade your Python as Python 2.7 won't be maintained after "
150+
"that date. A future version of pip will drop support for Python 2.7.",
151+
replacement=None,
152+
gone_in=None,
153+
)
146154

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

0 commit comments

Comments
 (0)