aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--urllib3/packages/__init__.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/urllib3/packages/__init__.py b/urllib3/packages/__init__.py
index 37e8351..10a3aa8 100644
--- a/urllib3/packages/__init__.py
+++ b/urllib3/packages/__init__.py
@@ -1,4 +1,9 @@
from __future__ import absolute_import
-from . import ssl_match_hostname
-
+try:
+ # cPython >= 2.7.9 has ssl features backported from Python3
+ from ssl import CertificateError
+ del CertificateError
+ import ssl as ssl_match_hostname
+except ImportError:
+ from . import ssl_match_hostname