Skip to content

Commit 56e3919

Browse files
miss-islingtonlightdrkhugovk
authored
[3.12] Refer to TimeoutError instead of asyncio.TimeoutError in asyncio-task.rst (GH-106136) (#106179)
Co-authored-by: lightdrk <[email protected]> Co-authored-by: Hugo van Kemenade <[email protected]>
1 parent 0373c2c commit 56e3919

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
@@ -651,16 +651,16 @@ Timeouts
651651
If ``long_running_task`` takes more than 10 seconds to complete,
652652
the context manager will cancel the current task and handle
653653
the resulting :exc:`asyncio.CancelledError` internally, transforming it
654-
into an :exc:`asyncio.TimeoutError` which can be caught and handled.
654+
into a :exc:`TimeoutError` which can be caught and handled.
655655

656656
.. note::
657657

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

663-
Example of catching :exc:`asyncio.TimeoutError`::
663+
Example of catching :exc:`TimeoutError`::
664664

665665
async def main():
666666
try:

0 commit comments

Comments
 (0)