jenkins-bot has submitted this change. (
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/761616 )
Change subject: [py2] keep setup.py Python2 compatible to raise RuntimeError instead of
others
......................................................................
[py2] keep setup.py Python2 compatible to raise RuntimeError instead of others
Change-Id: I65ca3765f054027d913616d5ac1a12f5f06d7afa
---
M setup.py
1 file changed, 6 insertions(+), 6 deletions(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/setup.py b/setup.py
index a8c77f4..4606e00 100644
--- a/setup.py
+++ b/setup.py
@@ -36,11 +36,6 @@
import os
import sys
-from setuptools import setup
-
-
-PYTHON_VERSION = sys.version_info[:3]
-
VERSIONS_REQUIRED_MESSAGE = """
Pywikibot is not available on:
{version}
@@ -48,10 +43,15 @@
This version of Pywikibot only supports Python 3.5.3+.
"""
+try:
+ from setuptools import setup
+except SyntaxError:
+ raise RuntimeError(VERSIONS_REQUIRED_MESSAGE.format(version=sys.version))
+
def python_is_supported():
"""Check that Python is supported."""
- return PYTHON_VERSION >= (3, 5, 3)
+ return sys.version_info[:3] >= (3, 5, 3)
if not python_is_supported(): # pragma: no cover
--
To view, visit
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/761616
To unsubscribe, or for help writing mail filters, visit
https://gerrit.wikimedia.org/r/settings
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: I65ca3765f054027d913616d5ac1a12f5f06d7afa
Gerrit-Change-Number: 761616
Gerrit-PatchSet: 2
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged