jenkins-bot has submitted this change and it was merged.
Change subject: [IMPROV] Remove 'PY3' switch
......................................................................
[IMPROV] Remove 'PY3' switch
Because Python 3 wasn't really supported until know, it was only
possible to run it with Python 3 if 'PY3' was set to '1'.
Change-Id: If0251bd5c9666e79a273c06b3ef4a3ea7995b0bf
---
M .travis.yml
M pwb.py
M setup.py
3 files changed, 10 insertions(+), 22 deletions(-)
Approvals:
John Vandenberg: Looks good to me, approved
jenkins-bot: Verified
diff --git a/.travis.yml b/.travis.yml
index 918f5f1..013a1b9 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -32,7 +32,6 @@
- python setup.py install
- cd ../..
- - if [[ $TRAVIS_PYTHON_VERSION == '3.3' ]]; then export PY3=1; fi
- python -c "import setuptools; print(setuptools.__version__)"
script:
diff --git a/pwb.py b/pwb.py
index 0423435..66b3aa0 100644
--- a/pwb.py
+++ b/pwb.py
@@ -78,23 +78,16 @@
#### end of snippet
-if not os.environ.get("PY3", False):
- if sys.version_info[0] != 2:
- raise RuntimeError("ERROR: Pywikibot only runs under Python 2")
- if sys.version_info < (2, 6, 5):
- raise RuntimeError("ERROR: Pywikibot only runs under Python 2.6.5 "
- "or higher")
-else:
- if sys.version_info[0] not in (2, 3):
- raise RuntimeError("ERROR: Pywikibot only runs under Python 2 "
- "or Python 3")
- version = tuple(sys.version_info)[:3]
- if version < (2, 6, 5):
- raise RuntimeError("ERROR: Pywikibot only runs under Python 2.6.5 "
- "or higher")
- if version >= (3, ) and version < (3, 3):
- raise RuntimeError("ERROR: Pywikibot only runs under Python 3.3 "
- "or higher")
+if sys.version_info[0] not in (2, 3):
+ raise RuntimeError("ERROR: Pywikibot only runs under Python 2 "
+ "or Python 3")
+version = tuple(sys.version_info)[:3]
+if version < (2, 6, 5):
+ raise RuntimeError("ERROR: Pywikibot only runs under Python 2.6.5 "
+ "or higher")
+if version >= (3, ) and version < (3, 3):
+ raise RuntimeError("ERROR: Pywikibot only runs under Python 3.3 "
+ "or higher")
rewrite_path = os.path.dirname(sys.argv[0])
if not os.path.isabs(rewrite_path):
diff --git a/setup.py b/setup.py
index 3c75371..22967ed 100644
--- a/setup.py
+++ b/setup.py
@@ -57,10 +57,6 @@
dependencies.append('ordereddict')
if sys.version_info[0] == 3:
- if not os.environ.get('PY3', False):
- # use setup.py test --python3ok to run tests
- print("ERROR: Pywikibot only runs under Python 2")
- sys.exit(1)
if sys.version_info[1] < 3:
print("ERROR: Python 3.3 or higher is required!")
sys.exit(1)
--
To view, visit
https://gerrit.wikimedia.org/r/161113
To unsubscribe, visit
https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: If0251bd5c9666e79a273c06b3ef4a3ea7995b0bf
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: XZise <CommodoreFabianus(a)gmx.de>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Ladsgroup <ladsgroup(a)gmail.com>
Gerrit-Reviewer: Merlijn van Deen <valhallasw(a)arctus.nl>
Gerrit-Reviewer: jenkins-bot <>