From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Fri, 9 Jul 2021 04:51:26 +0000 (-0700) Subject: Doc: Fix wrong exception used in example. (GH-26572) X-Git-Tag: v3.10.0b4~3 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=662ace109352174fbe2356d9dca0ce9c4330d7db;p=thirdparty%2FPython%2Fcpython.git Doc: Fix wrong exception used in example. (GH-26572) (cherry picked from commit 15f0fc571c1fbc84b6b74dfeb373ca3d35e4c5d7) Co-authored-by: Julien Palard --- diff --git a/Doc/library/asyncio-task.rst b/Doc/library/asyncio-task.rst index bbdef3345a4d..fb86892547b5 100644 --- a/Doc/library/asyncio-task.rst +++ b/Doc/library/asyncio-task.rst @@ -766,7 +766,7 @@ Scheduling From Other Threads try: result = future.result(timeout) - except asyncio.TimeoutError: + except concurrent.futures.TimeoutError: print('The coroutine took too long, cancelling the task...') future.cancel() except Exception as exc: