From 4ed79b78002d1c1bca8ea72aaadea07710aca4e9 Mon Sep 17 00:00:00 2001 From: "Miss Islington (bot)" <31488909+miss-islington@users.noreply.github.com> Date: Tue, 24 Dec 2019 03:04:12 -0800 Subject: Fix import path for asyncio.TimeoutError (GH-17691) (cherry picked from commit 025eeaa19607b2a80c979668dad405f567444573) Co-authored-by: Andrew Svetlov --- Lib/asyncio/staggered.py | 4 ++-- Misc/NEWS.d/next/Library/2019-12-24-10-43-13.bpo-39129.jVx5rW.rst | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) create mode 100644 Misc/NEWS.d/next/Library/2019-12-24-10-43-13.bpo-39129.jVx5rW.rst diff --git a/Lib/asyncio/staggered.py b/Lib/asyncio/staggered.py index 27c665a..451a53a 100644 --- a/Lib/asyncio/staggered.py +++ b/Lib/asyncio/staggered.py @@ -6,7 +6,7 @@ import contextlib import typing from . import events -from . import futures +from . import exceptions as exceptions_mod from . import locks from . import tasks @@ -83,7 +83,7 @@ async def staggered_race( previous_failed: typing.Optional[locks.Event]) -> None: # Wait for the previous task to finish, or for delay seconds if previous_failed is not None: - with contextlib.suppress(futures.TimeoutError): + with contextlib.suppress(exceptions_mod.TimeoutError): # Use asyncio.wait_for() instead of asyncio.wait() here, so # that if we get cancelled at this point, Event.wait() is also # cancelled, otherwise there will be a "Task destroyed but it is diff --git a/Misc/NEWS.d/next/Library/2019-12-24-10-43-13.bpo-39129.jVx5rW.rst b/Misc/NEWS.d/next/Library/2019-12-24-10-43-13.bpo-39129.jVx5rW.rst new file mode 100644 index 0000000..6667697 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2019-12-24-10-43-13.bpo-39129.jVx5rW.rst @@ -0,0 +1 @@ +Fix import path for ``asyncio.TimeoutError`` -- cgit v0.12