File tree Expand file tree Collapse file tree 1 file changed +4
-10
lines changed Expand file tree Collapse file tree 1 file changed +4
-10
lines changed Original file line number Diff line number Diff line change 20
20
21
21
_ThirdPartyClient = []
22
22
_ThirdPartyExecutor = [loky .reusable_executor ._ReusablePoolExecutor ]
23
+ _FutureTypes = [Set [Future ], Set [Task ]]
23
24
24
25
try :
25
26
import ipyparallel
28
29
with_ipyparallel = True
29
30
_ThirdPartyClient .append (ipyparallel .Client )
30
31
_ThirdPartyExecutor .append (ipyparallel .client .view .ViewExecutor )
32
+ _FutureTypes .append (AsyncResult )
31
33
except ModuleNotFoundError :
32
34
with_ipyparallel = False
33
35
@@ -306,11 +308,7 @@ def overhead(self):
306
308
307
309
def _process_futures (
308
310
self ,
309
- done_futs : Union [
310
- Set [Future ],
311
- Set [AsyncResult ], # XXX: AsyncResult might not be imported
312
- Set [Task ],
313
- ],
311
+ done_futs : Union [(* _FutureTypes ,)],
314
312
) -> None :
315
313
for fut in done_futs :
316
314
pid = self ._pending_tasks .pop (fut )
@@ -335,11 +333,7 @@ def _process_futures(
335
333
336
334
def _get_futures (
337
335
self ,
338
- ) -> Union [
339
- List [Task ],
340
- List [Future ],
341
- List [AsyncResult ], # XXX: AsyncResult might not be imported
342
- ]:
336
+ ) -> Union [(* _FutureTypes ,)]:
343
337
# Launch tasks to replace the ones that completed
344
338
# on the last iteration, making sure to fill workers
345
339
# that have started since the last iteration.
You can’t perform that action at this time.
0 commit comments