jenkins-bot has submitted this change and it was merged.
Change subject: Desupport Python 2.6 for Pywikibot 2.0 release branch ......................................................................
Desupport Python 2.6 for Pywikibot 2.0 release branch
Prevent setup.py and pwb.py from executing under Python 2.6. Adapted from 1db58db (Unicode Python issue #10254)
Bug: T114464 Change-Id: I4db6e5f5d6d87dbf90c16a38ee6f69a7b7f66f1f --- M pwb.py M setup.py 2 files changed, 42 insertions(+), 0 deletions(-)
Approvals: John Vandenberg: Looks good to me, but someone else must approve XZise: Looks good to me, approved jenkins-bot: Verified
diff --git a/pwb.py b/pwb.py index 9ccb5df..601c2d4 100755 --- a/pwb.py +++ b/pwb.py @@ -29,6 +29,27 @@
from warnings import warn
+PYTHON_VERSION = sys.version_info[:3] +PY2 = (PYTHON_VERSION[0] == 2) + +versions_required_message = """ +Pywikibot 2.0 is not available on: +%s + +Pywikibot is only supported under Python 2.7.2+ or 3.3+ +""" + + +def python_is_supported(): + """Check that Python is supported.""" + # Any change to this must be copied to setup.py + return (PYTHON_VERSION >= (3, 3, 0) or + (PY2 and PYTHON_VERSION >= (2, 7, 2))) + + +if not python_is_supported(): + raise RuntimeError(versions_required_message % sys.version) + pwb = None
diff --git a/setup.py b/setup.py index 3456b78..723f1ff 100644 --- a/setup.py +++ b/setup.py @@ -17,6 +17,27 @@ except ImportError: pass
+PYTHON_VERSION = sys.version_info[:3] +PY2 = (PYTHON_VERSION[0] == 2) + +versions_required_message = """ +Pywikibot 2.0 is not available on: +%s + +Pywikibot is only supported under Python 2.7.2+ or 3.3+ +""" + + +def python_is_supported(): + """Check that Python is supported.""" + # Any change to this must be copied to pwb.py + return (PYTHON_VERSION >= (3, 3, 0) or + (PY2 and PYTHON_VERSION >= (2, 7, 2))) + + +if not python_is_supported(): + raise RuntimeError(versions_required_message % sys.version) + test_deps = []
dependencies = ['httplib2>=0.9']
pywikibot-commits@lists.wikimedia.org