[3.13] gh-119121: Fix and test async.staggered.staggered_race (GH-119173) (#119206)

gh-119121: Fix and test `async.staggered.staggered_race` (GH-119173)
(cherry picked from commit 16b46ebd2b)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
This commit is contained in:
Miss Islington (bot) 2024-05-20 13:31:31 +02:00 committed by GitHub
parent 3b90807257
commit 3a8ab99bf7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 100 additions and 2 deletions

View file

@ -69,8 +69,7 @@ async def staggered_race(coro_fns, delay, *, loop=None):
exceptions = []
running_tasks = []
async def run_one_coro(
previous_failed: typing.Optional[locks.Event]) -> None:
async def run_one_coro(previous_failed) -> None:
# Wait for the previous task to finish, or for delay seconds
if previous_failed is not None:
with contextlib.suppress(exceptions_mod.TimeoutError):