Skip to content

Commit

Permalink
Support Python 2.7.9 SSL
Browse files Browse the repository at this point in the history
Python 2.7.9 includes a backport of the SSL module from Python 3,
which uses created an error in the test test_https_cert_error.

Bug: T78764
Change-Id: I745db16c74eddbeeb89a663170c25e3548532ca1
  • Loading branch information
jayvdb committed Dec 17, 2014
1 parent 40cfc31 commit 2b63c75
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions pywikibot/comms/http.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@

if sys.version_info[0] > 2:
from ssl import SSLError as SSLHandshakeError
SSL_CERT_VERIFY_FAILED_MSG = "SSL: CERTIFICATE_VERIFY_FAILED"
import queue as Queue
import urllib.parse as urlparse
from http import cookiejar as cookielib
Expand All @@ -55,11 +54,6 @@
elif httplib2.__version__ == '0.6.0':
from httplib2 import ServerNotFoundError as SSLHandshakeError

# The OpenSSL error code for
# certificate verify failed
# cf. `openssl errstr 14090086`
SSL_CERT_VERIFY_FAILED_MSG = ":14090086:"

import Queue
import urlparse
import cookielib
Expand All @@ -73,8 +67,15 @@
from pywikibot.tools import deprecate_arg
import pywikibot.version

_logger = "comm.http"
if sys.version_info[0] > 2 or sys.version_info[1] > 8:
SSL_CERT_VERIFY_FAILED_MSG = "SSL: CERTIFICATE_VERIFY_FAILED"
else:
# The OpenSSL error code for
# certificate verify failed
# cf. `openssl errstr 14090086`
SSL_CERT_VERIFY_FAILED_MSG = ":14090086:"

_logger = "comm.http"

# global variables

Expand Down

0 comments on commit 2b63c75

Please sign in to comment.