]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Fix import path for asyncio.TimeoutError (#17691)
authorAndrew Svetlov <andrew.svetlov@gmail.com>
Tue, 24 Dec 2019 10:46:42 +0000 (12:46 +0200)
committerGitHub <noreply@github.com>
Tue, 24 Dec 2019 10:46:42 +0000 (12:46 +0200)
Lib/asyncio/staggered.py
Misc/NEWS.d/next/Library/2019-12-24-10-43-13.bpo-39129.jVx5rW.rst [new file with mode: 0644]

index 27c665a9910ab2d239b9a448397dd38738b297e7..451a53a16f3831611b6fc9b55f9eff5468924793 100644 (file)
@@ -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 (file)
index 0000000..6667697
--- /dev/null
@@ -0,0 +1 @@
+Fix import path for ``asyncio.TimeoutError``