Skip to content

Commit 2cce465

Browse files
miss-islingtonlightdrkhugovk
authored
[3.11] Refer to TimeoutError instead of asyncio.TimeoutError in asyncio-task.rst (GH-106136) (#106180)
Co-authored-by: lightdrk <[email protected]> Co-authored-by: Hugo van Kemenade <[email protected]>
1 parent 9cc0533 commit 2cce465

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Doc/library/asyncio-task.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -601,16 +601,16 @@ Timeouts
601601
If ``long_running_task`` takes more than 10 seconds to complete,
602602
the context manager will cancel the current task and handle
603603
the resulting :exc:`asyncio.CancelledError` internally, transforming it
604-
into an :exc:`asyncio.TimeoutError` which can be caught and handled.
604+
into a :exc:`TimeoutError` which can be caught and handled.
605605

606606
.. note::
607607

608608
The :func:`asyncio.timeout` context manager is what transforms
609-
the :exc:`asyncio.CancelledError` into an :exc:`asyncio.TimeoutError`,
610-
which means the :exc:`asyncio.TimeoutError` can only be caught
609+
the :exc:`asyncio.CancelledError` into a :exc:`TimeoutError`,
610+
which means the :exc:`TimeoutError` can only be caught
611611
*outside* of the context manager.
612612

613-
Example of catching :exc:`asyncio.TimeoutError`::
613+
Example of catching :exc:`TimeoutError`::
614614

615615
async def main():
616616
try:

0 commit comments

Comments
 (0)