Skip to content

Commit

Permalink
Fix a mistake in merge
Browse files Browse the repository at this point in the history
  • Loading branch information
pradyunsg committed Nov 4, 2017
1 parent 0320093 commit 88924a4
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/pip/_vendor/requests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def check_compatibility(urllib3_version, chardet_version):
RequestsDependencyWarning)

# Attempt to enable urllib3's SNI support, if possible
from pip.compat import WINDOWS
from pip._internal.compat import WINDOWS
if not WINDOWS:
try:
from pip._vendor.urllib3.contrib import pyopenssl
Expand Down
16 changes: 15 additions & 1 deletion tasks/vendoring/patches/requests.patch
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
diff --git a/src/pip/_vendor/requests/packages.py b/src/pip/_vendor/requests/packages.py
index 7232fe0f..6336a07d 100644
--- a/src/pip/_vendor/requests/packages.py
+++ b/src/pip/_vendor/requests/packages.py
@@ -4,7 +4,7 @@ import sys
# I don't like it either. Just look the other way. :)

for package in ('urllib3', 'idna', 'chardet'):
- locals()[package] = __import__(package)
+ locals()[package] = __import__("pip._vendor." + package)
# This traversal is apparently necessary such that the identities are
# preserved (requests.packages.urllib3.* is urllib3.*)
for mod in list(sys.modules):

diff --git a/pip/_vendor/requests/__init__.py b/pip/_vendor/requests/__init__.py
index 9c3b769..36a4ef40 100644
--- a/src/pip/_vendor/requests/__init__.py
Expand All @@ -11,7 +25,7 @@ index 9c3b769..36a4ef40 100644
- pyopenssl.inject_into_urllib3()
-except ImportError:
- pass
+from pip.compat import WINDOWS
+from pip._internal.compat import WINDOWS
+if not WINDOWS:
+ try:
+ from pip._vendor.urllib3.contrib import pyopenssl
Expand Down

0 comments on commit 88924a4

Please sign in to comment.