Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a1a4ddf

Browse files
committed
(Merge 3.4) Issue #21376: document asyncio.TimeoutError
2 parents 20ed56c + 28d0ae4 commit a1a4ddf

1 file changed

Lines changed: 17 additions & 4 deletions

File tree

Doc/library/asyncio-task.rst

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,18 @@ InvalidStateError
142142
The operation is not allowed in this state.
143143

144144

145+
TimeoutError
146+
------------
147+
148+
.. exception:: TimeoutError
149+
150+
The operation exceeded the given deadline.
151+
152+
.. note::
153+
154+
This exception is different from the builtin :exc:`TimeoutError` exception!
155+
156+
145157
Future
146158
------
147159

@@ -400,7 +412,8 @@ Task functions
400412
Return an iterator whose values, when waited for, are :class:`Future`
401413
instances.
402414

403-
Raises :exc:`TimeoutError` if the timeout occurs before all Futures are done.
415+
Raises :exc:`asyncio.TimeoutError` if the timeout occurs before all Futures
416+
are done.
404417

405418
Example::
406419

@@ -521,8 +534,8 @@ Task functions
521534

522535
.. note::
523536

524-
This does not raise :exc:`TimeoutError`! Futures that aren't done when
525-
the timeout occurs are returned in the second set.
537+
This does not raise :exc:`asyncio.TimeoutError`! Futures that aren't done
538+
when the timeout occurs are returned in the second set.
526539

527540

528541
.. function:: wait_for(fut, timeout, \*, loop=None)
@@ -534,7 +547,7 @@ Task functions
534547
Coroutine will be wrapped in :class:`Task`.
535548

536549
Returns result of the Future or coroutine. When a timeout occurs, it
537-
cancels the task and raises :exc:`TimeoutError`. To avoid the task
550+
cancels the task and raises :exc:`asyncio.TimeoutError`. To avoid the task
538551
cancellation, wrap it in :func:`shield`.
539552

540553
This function is a :ref:`coroutine <coroutine>`.

0 commit comments

Comments
 (0)