137 lines
4.1 KiB
Diff
137 lines
4.1 KiB
Diff
Index: urllib3-1.5/urllib3/_collections.py
|
|
===================================================================
|
|
--- urllib3-1.5.orig/urllib3/_collections.py
|
|
+++ urllib3-1.5/urllib3/_collections.py
|
|
@@ -10,7 +10,10 @@ from threading import Lock
|
|
try: # Python 2.7+
|
|
from collections import OrderedDict
|
|
except ImportError:
|
|
- from .packages.ordered_dict import OrderedDict
|
|
+ try: # backport package
|
|
+ from ordereddict import OrderedDict
|
|
+ except ImportError:
|
|
+ from .packages.ordered_dict import OrderedDict
|
|
|
|
|
|
__all__ = ['RecentlyUsedContainer']
|
|
Index: urllib3-1.5/urllib3/connectionpool.py
|
|
===================================================================
|
|
--- urllib3-1.5.orig/urllib3/connectionpool.py
|
|
+++ urllib3-1.5/urllib3/connectionpool.py
|
|
@@ -51,8 +51,14 @@ from .exceptions import (
|
|
TimeoutError,
|
|
)
|
|
|
|
-from .packages.ssl_match_hostname import match_hostname, CertificateError
|
|
-from .packages import six
|
|
+try:
|
|
+ from backports.ssl_match_hostname import match_hostname, CertificateError
|
|
+except ImportError:
|
|
+ from .packages.ssl_match_hostname import match_hostname, CertificateError
|
|
+try:
|
|
+ import six
|
|
+except ImportError:
|
|
+ from .packages import six
|
|
|
|
|
|
xrange = six.moves.xrange
|
|
Index: urllib3-1.5/urllib3/filepost.py
|
|
===================================================================
|
|
--- urllib3-1.5.orig/urllib3/filepost.py
|
|
+++ urllib3-1.5/urllib3/filepost.py
|
|
@@ -10,8 +10,12 @@ import mimetypes
|
|
from uuid import uuid4
|
|
from io import BytesIO
|
|
|
|
-from .packages import six
|
|
-from .packages.six import b
|
|
+try:
|
|
+ import six
|
|
+ from six import b
|
|
+except ImportError:
|
|
+ from .packages import six
|
|
+ from .packages.six import b
|
|
|
|
writer = codecs.lookup('utf-8')[3]
|
|
|
|
Index: urllib3-1.5/urllib3/response.py
|
|
===================================================================
|
|
--- urllib3-1.5.orig/urllib3/response.py
|
|
+++ urllib3-1.5/urllib3/response.py
|
|
@@ -11,7 +11,10 @@ import zlib
|
|
from io import BytesIO
|
|
|
|
from .exceptions import DecodeError
|
|
-from .packages.six import string_types as basestring
|
|
+try:
|
|
+ from six import string_types as basestring
|
|
+except ImportError:
|
|
+ from .packages.six import string_types as basestring
|
|
|
|
|
|
log = logging.getLogger(__name__)
|
|
Index: urllib3-1.5/urllib3/util.py
|
|
===================================================================
|
|
--- urllib3-1.5.orig/urllib3/util.py
|
|
+++ urllib3-1.5/urllib3/util.py
|
|
@@ -18,7 +18,10 @@ except ImportError: # `poll` doesn't exi
|
|
except ImportError: # `select` doesn't exist on AppEngine.
|
|
select = False
|
|
|
|
-from .packages import six
|
|
+try:
|
|
+ import six
|
|
+except ImporError:
|
|
+ from .packages import six
|
|
from .exceptions import LocationParseError
|
|
|
|
|
|
Index: urllib3-1.5/test/test_collections.py
|
|
===================================================================
|
|
--- urllib3-1.5.orig/test/test_collections.py
|
|
+++ urllib3-1.5/test/test_collections.py
|
|
@@ -1,7 +1,10 @@
|
|
import unittest
|
|
|
|
from urllib3._collections import RecentlyUsedContainer as Container
|
|
-from urllib3.packages import six
|
|
+try:
|
|
+ import six
|
|
+except ImportError:
|
|
+ from urllib3.packages import six
|
|
xrange = six.moves.xrange
|
|
|
|
|
|
Index: urllib3-1.5/test/test_connectionpool.py
|
|
===================================================================
|
|
--- urllib3-1.5.orig/test/test_connectionpool.py
|
|
+++ urllib3-1.5/test/test_connectionpool.py
|
|
@@ -1,7 +1,10 @@
|
|
import unittest
|
|
|
|
from urllib3.connectionpool import connection_from_url, HTTPConnectionPool
|
|
-from urllib3.packages.ssl_match_hostname import CertificateError
|
|
+try:
|
|
+ from backports.ssl_match_hostname import CertificateError
|
|
+except ImportError:
|
|
+ from urllib3.packages.ssl_match_hostname import CertificateError
|
|
from urllib3.exceptions import (
|
|
ClosedPoolError,
|
|
EmptyPoolError,
|
|
Index: urllib3-1.5/test/test_filepost.py
|
|
===================================================================
|
|
--- urllib3-1.5.orig/test/test_filepost.py
|
|
+++ urllib3-1.5/test/test_filepost.py
|
|
@@ -1,7 +1,10 @@
|
|
import unittest
|
|
|
|
from urllib3.filepost import encode_multipart_formdata, iter_fields
|
|
-from urllib3.packages.six import b, u
|
|
+try:
|
|
+ from six import b, u
|
|
+except ImportError:
|
|
+ from urllib3.packages.six import b, u
|
|
|
|
|
|
BOUNDARY = '!! test boundary !!'
|