12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576 |
- diff --git a/src/pip/_vendor/requests/packages.py b/src/pip/_vendor/requests/packages.py
- index 6336a07d..9582fa73 100644
- --- a/src/pip/_vendor/requests/packages.py
- +++ b/src/pip/_vendor/requests/packages.py
- @@ -4,11 +4,13 @@ import sys
- # I don't like it either. Just look the other way. :)
- for package in ('urllib3', 'idna', 'chardet'):
- - locals()[package] = __import__(package)
- + vendored_package = "pip._vendor." + package
- + locals()[package] = __import__(vendored_package)
- # This traversal is apparently necessary such that the identities are
- # preserved (requests.packages.urllib3.* is urllib3.*)
- for mod in list(sys.modules):
- - if mod == package or mod.startswith(package + '.'):
- - sys.modules['requests.packages.' + mod] = sys.modules[mod]
- + if mod == vendored_package or mod.startswith(vendored_package + '.'):
- + unprefixed_mod = mod[len("pip._vendor."):]
- + sys.modules['pip._vendor.requests.packages.' + unprefixed_mod] = sys.modules[mod]
- # Kinda cool, though, right?
- diff --git a/src/pip/_vendor/requests/__init__.py b/src/pip/_vendor/requests/__init__.py
- index 9c3b769..36a4ef40 100644
- --- a/src/pip/_vendor/requests/__init__.py
- +++ b/src/pip/_vendor/requests/__init__.py
- @@ -80,13 +80,15 @@ except (AssertionError, ValueError):
- RequestsDependencyWarning)
- # Attempt to enable urllib3's SNI support, if possible
- -try:
- - from pip._vendor.urllib3.contrib import pyopenssl
- - pyopenssl.inject_into_urllib3()
- -
- - # Check cryptography version
- - from cryptography import __version__ as cryptography_version
- - _check_cryptography(cryptography_version)
- -except ImportError:
- - pass
- +from pip._internal.utils.compat import WINDOWS
- +if not WINDOWS:
- + try:
- + from pip._vendor.urllib3.contrib import pyopenssl
- + pyopenssl.inject_into_urllib3()
- +
- + # Check cryptography version
- + from cryptography import __version__ as cryptography_version
- + _check_cryptography(cryptography_version)
- + except ImportError:
- + pass
- # urllib3's DependencyWarnings should be silenced.
- diff --git a/src/pip/_vendor/requests/compat.py b/src/pip/_vendor/requests/compat.py
- index eb6530d..353ec29 100644
- --- a/src/pip/_vendor/requests/compat.py
- +++ b/src/pip/_vendor/requests/compat.py
- @@ -25,10 +25,14 @@
- #: Python 3.x?
- is_py3 = (_ver[0] == 3)
- -try:
- - import simplejson as json
- -except ImportError:
- - import json
- +# Note: We've patched out simplejson support in pip because it prevents
- +# upgrading simplejson on Windows.
- +# try:
- +# import simplejson as json
- +# except (ImportError, SyntaxError):
- +# # simplejson does not support Python 3.2, it throws a SyntaxError
- +# # because of u'...' Unicode literals.
- +import json
- # ---------
- # Specifics
|