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 2020
2121_ThirdPartyClient = []
2222_ThirdPartyExecutor = [loky .reusable_executor ._ReusablePoolExecutor ]
23+ _FutureTypes = [Set [Future ], Set [Task ]]
2324
2425try :
2526 import ipyparallel
2829 with_ipyparallel = True
2930 _ThirdPartyClient .append (ipyparallel .Client )
3031 _ThirdPartyExecutor .append (ipyparallel .client .view .ViewExecutor )
32+ _FutureTypes .append (AsyncResult )
3133except ModuleNotFoundError :
3234 with_ipyparallel = False
3335
@@ -306,11 +308,7 @@ def overhead(self):
306308
307309 def _process_futures (
308310 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 ,)],
314312 ) -> None :
315313 for fut in done_futs :
316314 pid = self ._pending_tasks .pop (fut )
@@ -335,11 +333,7 @@ def _process_futures(
335333
336334 def _get_futures (
337335 self ,
338- ) -> Union [
339- List [Task ],
340- List [Future ],
341- List [AsyncResult ], # XXX: AsyncResult might not be imported
342- ]:
336+ ) -> Union [(* _FutureTypes ,)]:
343337 # Launch tasks to replace the ones that completed
344338 # on the last iteration, making sure to fill workers
345339 # that have started since the last iteration.
You can’t perform that action at this time.
0 commit comments