fix: address review-bot findings on merged PRs (#593)

Squashed from PR #595. Closes #593.
This commit is contained in:
Vito Sansevero
2026-10-31 23:13:59 -07:00
parent 01a4f1d989
commit 85441aa637
10 changed files with 165 additions and 40 deletions
+6 -4
View File
@@ -165,10 +165,12 @@ def _collect(func, items, futures):
and wait for its running ones, as the old per-call pool's exit did."""
try:
return _run_rest(func, items, futures)
except BaseException:
for future in futures:
future.cancel()
wait(futures)
except BaseException: # re-raised below, after the running items stop
# Wait only for what could not be cancelled (running or done). A
# future ``shutdown(cancel_futures=True)`` already cancelled stays
# CANCELLED, never notified, and ``wait`` would block on it forever
# (#593); ``cancel()`` is True for those as well.
wait([future for future in futures if not future.cancel()])
raise