06f8836
Index: urllib3-1.5/urllib3/_collections.py
06f8836
===================================================================
06f8836
--- urllib3-1.5.orig/urllib3/_collections.py
06f8836
+++ urllib3-1.5/urllib3/_collections.py
06f8836
@@ -10,7 +10,10 @@ from threading import Lock
e2c2602
 try: # Python 2.7+
e2c2602
     from collections import OrderedDict
e2c2602
 except ImportError:
e2c2602
-    from .packages.ordered_dict import OrderedDict
06f8836
+    try: # backport package
06f8836
+        from ordereddict import OrderedDict
06f8836
+    except ImportError:
06f8836
+        from .packages.ordered_dict import OrderedDict
06f8836
 
06f8836
 
06f8836
 __all__ = ['RecentlyUsedContainer']
06f8836
Index: urllib3-1.5/urllib3/connectionpool.py
06f8836
===================================================================
06f8836
--- urllib3-1.5.orig/urllib3/connectionpool.py
06f8836
+++ urllib3-1.5/urllib3/connectionpool.py
06f8836
@@ -51,8 +51,20 @@ from .exceptions import (
06f8836
     TimeoutError,
e2c2602
 )
06f8836
 
06f8836
-from .packages.ssl_match_hostname import match_hostname, CertificateError
e2c2602
-from .packages import six
131a805
+try:
131a805
+    # python3.2+
131a805
+    from ssl import match_hostname, CertificateError
131a805
+except ImportError:
06f8836
+    try:
06f8836
+        # Older python where the backport from pypi is installed
06f8836
+        from backports.ssl_match_hostname import match_hostname, CertificateError
06f8836
+    except ImportError:
06f8836
+        # Other older python we use our bundled copy
06f8836
+        from .packages.ssl_match_hostname import match_hostname, CertificateError
e2c2602
+try:
06f8836
+    import six
e2c2602
+except ImportError:
06f8836
+    from .packages import six
1563f31
 
1563f31
 
06f8836
 xrange = six.moves.xrange
06f8836
Index: urllib3-1.5/urllib3/filepost.py
06f8836
===================================================================
06f8836
--- urllib3-1.5.orig/urllib3/filepost.py
06f8836
+++ urllib3-1.5/urllib3/filepost.py
06f8836
@@ -10,8 +10,12 @@ import mimetypes
e2c2602
 from uuid import uuid4
e2c2602
 from io import BytesIO
e2c2602
 
e2c2602
-from .packages import six
e2c2602
-from .packages.six import b
06f8836
+try:
06f8836
+    import six
06f8836
+    from six import b
06f8836
+except ImportError:
06f8836
+    from .packages import six
06f8836
+    from .packages.six import b
e2c2602
 
e2c2602
 writer = codecs.lookup('utf-8')[3]
e2c2602
 
06f8836
Index: urllib3-1.5/urllib3/response.py
06f8836
===================================================================
06f8836
--- urllib3-1.5.orig/urllib3/response.py
06f8836
+++ urllib3-1.5/urllib3/response.py
06f8836
@@ -11,7 +11,10 @@ import zlib
06f8836
 from io import BytesIO
06f8836
 
e2c2602
 from .exceptions import DecodeError
06f8836
-from .packages.six import string_types as basestring
06f8836
+try:
06f8836
+    from six import string_types as basestring
06f8836
+except ImportError:
06f8836
+    from .packages.six import string_types as basestring
06f8836
 
06f8836
 
06f8836
 log = logging.getLogger(__name__)
06f8836
Index: urllib3-1.5/urllib3/util.py
06f8836
===================================================================
06f8836
--- urllib3-1.5.orig/urllib3/util.py
06f8836
+++ urllib3-1.5/urllib3/util.py
06f8836
@@ -18,7 +18,10 @@ except ImportError: # `poll` doesn't exi
06f8836
     except ImportError: # `select` doesn't exist on AppEngine.
06f8836
         select = False
06f8836
 
06f8836
-from .packages import six
06f8836
+try:
06f8836
+    import six
06f8836
+except ImporError:
06f8836
+    from .packages import six
06f8836
 from .exceptions import LocationParseError
06f8836
 
06f8836
 
06f8836
Index: urllib3-1.5/test/test_collections.py
06f8836
===================================================================
06f8836
--- urllib3-1.5.orig/test/test_collections.py
06f8836
+++ urllib3-1.5/test/test_collections.py
06f8836
@@ -1,7 +1,10 @@
06f8836
 import unittest
06f8836
 
06f8836
 from urllib3._collections import RecentlyUsedContainer as Container
06f8836
-from urllib3.packages import six
06f8836
+try:
06f8836
+    import six
06f8836
+except ImportError:
06f8836
+    from urllib3.packages import six
06f8836
 xrange = six.moves.xrange
e2c2602
 
e2c2602
 
06f8836
Index: urllib3-1.5/test/test_connectionpool.py
06f8836
===================================================================
06f8836
--- urllib3-1.5.orig/test/test_connectionpool.py
06f8836
+++ urllib3-1.5/test/test_connectionpool.py
06f8836
@@ -1,7 +1,16 @@
06f8836
 import unittest
06f8836
 
06f8836
 from urllib3.connectionpool import connection_from_url, HTTPConnectionPool
06f8836
-from urllib3.packages.ssl_match_hostname import CertificateError
06f8836
+try:
06f8836
+    # python3.2+
06f8836
+    from ssl import CertificateError
06f8836
+except ImportError:
06f8836
+    try:
06f8836
+        # Older python where the backport from pypi is installed
06f8836
+        from backports.ssl_match_hostname import CertificateError
06f8836
+    except ImportError:
06f8836
+        # Other older python we use our bundled copy
06f8836
+        from urllib3.packages.ssl_match_hostname import CertificateError
06f8836
 from urllib3.exceptions import (
06f8836
     ClosedPoolError,
06f8836
     EmptyPoolError,
06f8836
Index: urllib3-1.5/test/test_filepost.py
06f8836
===================================================================
06f8836
--- urllib3-1.5.orig/test/test_filepost.py
06f8836
+++ urllib3-1.5/test/test_filepost.py
06f8836
@@ -1,7 +1,10 @@
06f8836
 import unittest
e2c2602
 
06f8836
 from urllib3.filepost import encode_multipart_formdata, iter_fields
06f8836
-from urllib3.packages.six import b, u
06f8836
+try:
06f8836
+    from six import b, u
06f8836
+except ImportError:
06f8836
+    from urllib3.packages.six import b, u
e2c2602
 
e2c2602
 
06f8836
 BOUNDARY = '!! test boundary !!'
06f8836
Index: urllib3-1.5/setup.py
06f8836
===================================================================
06f8836
--- urllib3-1.5.orig/setup.py
06f8836
+++ urllib3-1.5/setup.py
06f8836
@@ -44,8 +44,7 @@ setup(name='urllib3',
06f8836
       author_email='andrey.petrov@shazow.net',
06f8836
       url='http://urllib3.readthedocs.org/',
06f8836
       license='MIT',
06f8836
-      packages=['urllib3', 'dummyserver', 'urllib3.packages',
06f8836
-                'urllib3.packages.ssl_match_hostname',
06f8836
+      packages=['urllib3', 'dummyserver', 'urllib3',
06f8836
                 ],
06f8836
       requires=requirements,
06f8836
       tests_require=tests_requirements,