File tree 3 files changed +28
-4
lines changed
3 files changed +28
-4
lines changed Original file line number Diff line number Diff line change
1
+ Remove unused optional ``tornado `` import in vendored ``tenacity `` to prevent old versions of Tornado from breaking pip.
Original file line number Diff line number Diff line change 22
22
except ImportError :
23
23
iscoroutinefunction = None
24
24
25
- try :
26
- import tornado
27
- except ImportError :
28
- tornado = None
25
+ # Replace a conditional import with a hard-coded None so that pip does
26
+ # not attempt to use tornado even if it is present in the environment.
27
+ # If tornado is non-None, tenacity will attempt to execute some code
28
+ # that is sensitive to the version of tornado, which could break pip
29
+ # if an old version is found.
30
+ tornado = None
29
31
30
32
import sys
31
33
import threading
Original file line number Diff line number Diff line change
1
+ diff --git a/src/pip/_vendor/tenacity/__init__.py b/src/pip/_vendor/tenacity/__init__.py
2
+ index 5f8cb5058..42e9d8940 100644
3
+ --- a/src/pip/_vendor/tenacity/__init__.py
4
+ +++ b/src/pip/_vendor/tenacity/__init__.py
5
+ @@ -22,10 +22,12 @@ try:
6
+ except ImportError:
7
+ iscoroutinefunction = None
8
+
9
+ - try:
10
+ - import tornado
11
+ - except ImportError:
12
+ - tornado = None
13
+ + # Replace a conditional import with a hard-coded None so that pip does
14
+ + # not attempt to use tornado even if it is present in the environment.
15
+ + # If tornado is non-None, tenacity will attempt to execute some code
16
+ + # that is sensitive to the version of tornado, which could break pip
17
+ + # if an old version is found.
18
+ + tornado = None
19
+
20
+ import sys
21
+ import threading
You can’t perform that action at this time.
0 commit comments