| 74 | on_completed_fut = None |
| 75 | |
| 76 | def task_done(task): |
| 77 | running_tasks.discard(task) |
| 78 | futures.future_discard_from_awaited_by(task, parent_task) |
| 79 | if ( |
| 80 | on_completed_fut is not None |
| 81 | and not on_completed_fut.done() |
| 82 | and not running_tasks |
| 83 | ): |
| 84 | on_completed_fut.set_result(None) |
| 85 | |
| 86 | if task.cancelled(): |
| 87 | return |
| 88 | |
| 89 | exc = task.exception() |
| 90 | if exc is None: |
| 91 | return |
| 92 | unhandled_exceptions.append(exc) |
| 93 | |
| 94 | async def run_one_coro(ok_to_start, previous_failed) -> None: |
| 95 | # in eager tasks this waits for the calling task to append this task |