Skip to content

Commit 541a10f

Browse files
lightdrkhugovk
andauthored
Refer to TimeoutError instead of asyncio.TimeoutError in asyncio-task.rst (#106136)
Co-authored-by: Hugo van Kemenade <[email protected]>
1 parent 1f74b9e commit 541a10f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Doc/library/asyncio-task.rst

+4-4
Original file line numberDiff line numberDiff line change
@@ -654,16 +654,16 @@ Timeouts
654654
If ``long_running_task`` takes more than 10 seconds to complete,
655655
the context manager will cancel the current task and handle
656656
the resulting :exc:`asyncio.CancelledError` internally, transforming it
657-
into an :exc:`asyncio.TimeoutError` which can be caught and handled.
657+
into a :exc:`TimeoutError` which can be caught and handled.
658658

659659
.. note::
660660

661661
The :func:`asyncio.timeout` context manager is what transforms
662-
the :exc:`asyncio.CancelledError` into an :exc:`asyncio.TimeoutError`,
663-
which means the :exc:`asyncio.TimeoutError` can only be caught
662+
the :exc:`asyncio.CancelledError` into a :exc:`TimeoutError`,
663+
which means the :exc:`TimeoutError` can only be caught
664664
*outside* of the context manager.
665665

666-
Example of catching :exc:`asyncio.TimeoutError`::
666+
Example of catching :exc:`TimeoutError`::
667667

668668
async def main():
669669
try:

0 commit comments

Comments
 (0)