Skip to content

Commit

Permalink
Do not optionally load C dependencies in requests (#4035)
Browse files Browse the repository at this point in the history
  • Loading branch information
dstufft authored Oct 28, 2016
1 parent b1720f3 commit cab0177
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 11 deletions.
1 change: 1 addition & 0 deletions pip/_vendor/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ Modifications
* pkg_resources has been modified to import its externs from pip._vendor
* CacheControl has been modified to import its dependencies from pip._vendor
* packaging has been modified to import its dependencies from pip._vendor
* requests has been modified *not* to optionally load any C dependencies.


Debundling
Expand Down
12 changes: 7 additions & 5 deletions pip/_vendor/requests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,13 @@
__copyright__ = 'Copyright 2016 Kenneth Reitz'

# Attempt to enable urllib3's SNI support, if possible
try:
from .packages.urllib3.contrib import pyopenssl
pyopenssl.inject_into_urllib3()
except ImportError:
pass
# Note: Patched by pip to prevent using the PyOpenSSL module. On Windows this
# prevents upgrading cryptography.
# try:
# from .packages.urllib3.contrib import pyopenssl
# pyopenssl.inject_into_urllib3()
# except ImportError:
# pass

import warnings

Expand Down
14 changes: 8 additions & 6 deletions pip/_vendor/requests/compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,14 @@
#: Python 3.x?
is_py3 = (_ver[0] == 3)

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
# 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
Expand Down

0 comments on commit cab0177

Please sign in to comment.