jenkins-bot has submitted this change and it was merged.
Change subject: Fix httplib2 0.6.0 support
......................................................................
Fix httplib2 0.6.0 support
- fix httplib2 0.6.0 version string, otherwise StrictVersion fails
- add missing SSLHandshakeError
Change-Id: Idc58f303ca873075b96f3c78beb73dc11e8f24ab
---
M pwb.py
M pywikibot/comms/http.py
2 files changed, 15 insertions(+), 3 deletions(-)
Approvals:
John Vandenberg: Looks good to me, but someone else must approve
Legoktm: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pwb.py b/pwb.py
index a375826..c8f0cf8 100644
--- a/pwb.py
+++ b/pwb.py
@@ -109,15 +109,19 @@
except ImportError as e:
print("ImportError: %s" % e)
print("Python module httplib2 >= 0.6.0 is required.")
- print("Did you clone without --recursive?"
+ print("Did you clone without --recursive?\n"
"Try running 'git submodule update --init'.")
sys.exit(1)
+# httplib2 0.6.0 was released with __version__ as '$Rev$'
+# and no module variable CA_CERTS.
+if httplib2.__version__ == '$Rev$' and 'CA_CERTS' not in
httplib2.__dict__:
+ httplib2.__version__ = '0.6.0'
from distutils.version import StrictVersion
if StrictVersion(httplib2.__version__) < StrictVersion("0.6.0"):
print("Python module httplib2 (%s) needs to be 0.6.0 or greater." %
httplib2.__file__)
- print("Did you clone without --recursive?"
+ print("Did you clone without --recursive?\n"
"Try running 'git submodule update --init'.")
sys.exit(1)
diff --git a/pywikibot/comms/http.py b/pywikibot/comms/http.py
index cae3ab0..95d0cdc 100644
--- a/pywikibot/comms/http.py
+++ b/pywikibot/comms/http.py
@@ -33,13 +33,21 @@
sys.exit(1)
from distutils.version import StrictVersion
+# httplib2 0.6.0 was released with __version__ as '$Rev$'
+# and no module variable CA_CERTS.
+if httplib2.__version__ == '$Rev$' and 'CA_CERTS' not in
httplib2.__dict__:
+ httplib2.__version__ = '0.6.0'
if StrictVersion(httplib2.__version__) < StrictVersion("0.6.0"):
print("Error: Python module httplib2 (%s) is not 0.6.0 or greater." %
httplib2.__file__)
sys.exit(1)
if sys.version_info[0] == 2:
- from httplib2 import SSLHandshakeError
+ if 'SSLHandshakeError' in httplib2.__dict__:
+ from httplib2 import SSLHandshakeError
+ elif httplib2.__version__ == '0.6.0':
+ from httplib2 import ServerNotFoundError as SSLHandshakeError
+
import Queue
import urlparse
import cookielib
--
To view, visit
https://gerrit.wikimedia.org/r/141639
To unsubscribe, visit
https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Idc58f303ca873075b96f3c78beb73dc11e8f24ab
Gerrit-PatchSet: 2
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Legoktm <legoktm.wikipedia(a)gmail.com>
Gerrit-Reviewer: Merlijn van Deen <valhallasw(a)arctus.nl>
Gerrit-Reviewer: Mineo <themineo(a)gmail.com>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot <>