File tree Expand file tree Collapse file tree 1 file changed +17
-14
lines changed Expand file tree Collapse file tree 1 file changed +17
-14
lines changed Original file line number Diff line number Diff line change 7
7
old to handle TLSv1.2.
8
8
"""
9
9
10
- try :
11
- import ssl
12
- except ImportError :
13
- pass
14
- else :
15
- import sys
10
+ import sys
16
11
17
- # Checks for OpenSSL 1.0.1 on MacOS
18
- if sys .platform == "darwin" and ssl .OPENSSL_VERSION_NUMBER < 0x1000100f :
19
- try :
20
- from pip ._vendor .urllib3 .contrib import securetransport
21
- except (ImportError , OSError ):
22
- pass
23
- else :
24
- securetransport .inject_into_urllib3 ()
12
+
13
+ # Only relevant on macOS
14
+ if sys .platform == "darwin" :
15
+ try :
16
+ import ssl
17
+ except ImportError :
18
+ pass
19
+ else :
20
+ # Checks for OpenSSL 1.0.1
21
+ if ssl .OPENSSL_VERSION_NUMBER < 0x1000100f :
22
+ try :
23
+ from pip ._vendor .urllib3 .contrib import securetransport
24
+ except (ImportError , OSError ):
25
+ pass
26
+ else :
27
+ securetransport .inject_into_urllib3 ()
You can’t perform that action at this time.
0 commit comments