File tree 1 file changed +2
-17
lines changed 1 file changed +2
-17
lines changed Original file line number Diff line number Diff line change @@ -48,23 +48,8 @@ def all_tasks(loop=None):
48
48
# capturing the set of eager tasks first, so if an eager task "graduates"
49
49
# to a regular task in another thread, we don't risk missing it.
50
50
eager_tasks = list (_eager_tasks )
51
- # Looping over the WeakSet isn't safe as it can be updated from another
52
- # thread, therefore we cast it to list prior to filtering. The list cast
53
- # itself requires iteration, so we repeat it several times ignoring
54
- # RuntimeErrors (which are not very likely to occur).
55
- # See issues 34970 and 36607 for details.
56
- scheduled_tasks = None
57
- i = 0
58
- while True :
59
- try :
60
- scheduled_tasks = list (_scheduled_tasks )
61
- except RuntimeError :
62
- i += 1
63
- if i >= 1000 :
64
- raise
65
- else :
66
- break
67
- return {t for t in itertools .chain (scheduled_tasks , eager_tasks )
51
+
52
+ return {t for t in itertools .chain (_scheduled_tasks , eager_tasks )
68
53
if futures ._get_loop (t ) is loop and not t .done ()}
69
54
70
55
You can’t perform that action at this time.
0 commit comments