File tree Expand file tree Collapse file tree 1 file changed +2
-17
lines changed Expand file tree Collapse file tree 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):
4848 # capturing the set of eager tasks first, so if an eager task "graduates"
4949 # to a regular task in another thread, we don't risk missing it.
5050 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 )
6853 if futures ._get_loop (t ) is loop and not t .done ()}
6954
7055
You can’t perform that action at this time.
0 commit comments