File tree 4 files changed +31
-19
lines changed 4 files changed +31
-19
lines changed Original file line number Diff line number Diff line change
1
+ Limit the disabling of requests' pyopenssl to Windows only. Fixes "SNIMissingWarning / InsecurePlatformWarning not fixable with pip 9.0 / 9.0.1" (for non-Windows)
Original file line number Diff line number Diff line change @@ -97,7 +97,7 @@ Modifications
97
97
* ``pkg_resources `` has been modified to import its dependencies from ``pip._vendor ``
98
98
* ``CacheControl `` has been modified to import its dependencies from ``pip._vendor ``
99
99
* ``packaging `` has been modified to import its dependencies from ``pip._vendor ``
100
- * ``requests `` has been modified *not * to optionally load any C dependencies
100
+ * ``requests `` has been modified to *not * load C dependencies: `` simplejson `` (all platforms) and `` pyopenssl `` (Windows)
101
101
* Modified distro to delay importing ``argparse `` to avoid errors on 2.6
102
102
103
103
Original file line number Diff line number Diff line change 47
47
__license__ = 'Apache 2.0'
48
48
__copyright__ = 'Copyright 2016 Kenneth Reitz'
49
49
50
+
51
+ from pip .compat import WINDOWS
52
+
53
+
50
54
# Attempt to enable urllib3's SNI support, if possible
51
- # Note: Patched by pip to prevent using the PyOpenSSL module. On Windows this
52
- # prevents upgrading cryptography.
53
- # try:
54
- # from .packages.urllib3.contrib import pyopenssl
55
- # pyopenssl.inject_into_urllib3()
56
- # except ImportError:
57
- # pass
55
+ # Note: Patched by pip to prevent using the PyOpenSSL module when OS is Windows.
56
+ # Otherwise on Windows this would prevent upgrading cryptography.
57
+ if not WINDOWS :
58
+ try :
59
+ from .packages .urllib3 .contrib import pyopenssl
60
+ pyopenssl .inject_into_urllib3 ()
61
+ except ImportError :
62
+ pass
58
63
59
64
import warnings
60
65
Original file line number Diff line number Diff line change 1
1
diff --git a/pip/_vendor/requests/__init__.py b/pip/_vendor/requests/__init__.py
2
- index 9c3b769..44f6836 100644
2
+ index 9c3b769..36a4ef40 100644
3
3
--- a/pip/_vendor/requests/__init__.py
4
4
+++ b/pip/_vendor/requests/__init__.py
5
- @@ -48,11 +48,13 @@ __license__ = 'Apache 2.0'
5
+ @@ -47,12 +47,19 @@ __author__ = 'Kenneth Reitz'
6
+ __license__ = 'Apache 2.0'
6
7
__copyright__ = 'Copyright 2016 Kenneth Reitz'
7
-
8
+
9
+ +
10
+ + from pip.compat import WINDOWS
11
+ +
12
+ +
8
13
# Attempt to enable urllib3's SNI support, if possible
9
14
- try:
10
15
- from .packages.urllib3.contrib import pyopenssl
11
16
- pyopenssl.inject_into_urllib3()
12
17
- except ImportError:
13
18
- pass
14
- + # Note: Patched by pip to prevent using the PyOpenSSL module. On Windows this
15
- + # prevents upgrading cryptography.
16
- + # try:
17
- + # from .packages.urllib3.contrib import pyopenssl
18
- + # pyopenssl.inject_into_urllib3()
19
- + # except ImportError:
20
- + # pass
21
-
19
+ + # Note: Patched by pip to prevent using the PyOpenSSL module when OS is Windows.
20
+ + # Otherwise on Windows this would prevent upgrading cryptography.
21
+ + if not WINDOWS:
22
+ + try:
23
+ + from .packages.urllib3.contrib import pyopenssl
24
+ + pyopenssl.inject_into_urllib3()
25
+ + except ImportError:
26
+ + pass
27
+
22
28
import warnings
23
29
24
30
diff --git a/pip/_vendor/requests/compat.py b/pip/_vendor/requests/compat.py
You can’t perform that action at this time.
0 commit comments