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