[Python-checkins] Doc: Fix wrong exception used in example. (GH-26572)

JulienPalard webhook-mailer at python.org
Thu Jul 8 03:31:43 EDT 2021


https://github.com/python/cpython/commit/15f0fc571c1fbc84b6b74dfeb373ca3d35e4c5d7
commit: 15f0fc571c1fbc84b6b74dfeb373ca3d35e4c5d7
branch: main
author: Julien Palard <julien at palard.fr>
committer: JulienPalard <julien at palard.fr>
date: 2021-07-08T09:31:28+02:00
summary:

Doc: Fix wrong exception used in example. (GH-26572)

files:
M Doc/library/asyncio-task.rst

diff --git a/Doc/library/asyncio-task.rst b/Doc/library/asyncio-task.rst
index 44ec3cc8826c0..107578fc72203 100644
--- a/Doc/library/asyncio-task.rst
+++ b/Doc/library/asyncio-task.rst
@@ -763,7 +763,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:



More information about the Python-checkins mailing list