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