From dfe83841abbb316ae95eaf437d041c35e8e02085 Mon Sep 17 00:00:00 2001 From: Thomas Grainger Date: Sat, 4 Jan 2025 09:08:46 +0000 Subject: [PATCH] Update Lib/asyncio/staggered.py --- Lib/asyncio/staggered.py | 1 + 1 file changed, 1 insertion(+) diff --git a/Lib/asyncio/staggered.py b/Lib/asyncio/staggered.py index 0378fa44b73735..ef9aaff47f36fe 100644 --- a/Lib/asyncio/staggered.py +++ b/Lib/asyncio/staggered.py @@ -152,6 +152,7 @@ async def run_one_coro(ok_to_start, previous_failed) -> None: # first_task has been appended to running_tasks so first_task is ok to start. ok_to_start.set() propagate_cancellation_error = None + # Make sure no tasks are left running if we leave this function while running_tasks: if on_completed_fut is None: on_completed_fut = loop.create_future()