Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cli, setup: hard-code Python 2 EOL message #1969

Merged
merged 1 commit into from
Dec 17, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
from __future__ import absolute_import, division, print_function, unicode_literals

import sys
import time

try:
from setuptools import setup, __version__ as setuptools_version
Expand Down Expand Up @@ -42,12 +41,9 @@
raise ImportError('Sopel requires Python 2.7+ or 3.3+.')
# Py2 EOL: https://www.python.org/dev/peps/pep-0373/#maintenance-releases
if sys.version_info.major == 2:
now = time.time()
state = "has reached end of life"
if now >= 1588291200: # 2020-05-01 00:00:00 UTC
state += " and will receive no further updates"
print(
"Warning: Python 2 %s. Sopel 8.0 will drop support for it." % state,
'Warning: Python 2.x has reached end of life and will receive '
'no further updates. Sopel 8.0 will drop support for it.',
file=sys.stderr,
)

Expand Down
8 changes: 3 additions & 5 deletions sopel/cli/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,9 @@
tools.stderr('Error: Sopel requires Python 2.7+ or 3.3+.')
sys.exit(1)
if sys.version_info.major == 2:
now = time.time()
state = 'has reached end of life'
if now >= 1588291200: # 2020-05-01 00:00:00 UTC
state += ' and will receive no further updates'
tools.stderr('Warning: Python 2.x %s. Sopel 8.0 will drop support for it.' % state)
tools.stderr(
'Warning: Python 2.x has reached end of life and will receive '
'no further updates. Sopel 8.0 will drop support for it.')
dgw marked this conversation as resolved.
Show resolved Hide resolved

LOGGER = logging.getLogger(__name__)

Expand Down