diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2014-05-28 22:04:57 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2014-05-28 22:04:57 (GMT) |
commit | 28d0ae48e91bc08062b6c996b79fb148b8cf0303 (patch) | |
tree | 3f006ccd9b76e2152207436c1b9472f5d3276e14 /Doc | |
parent | 12c575f2f6213478c29445e7092164227e125490 (diff) | |
download | cpython-28d0ae48e91bc08062b6c996b79fb148b8cf0303.zip cpython-28d0ae48e91bc08062b6c996b79fb148b8cf0303.tar.gz cpython-28d0ae48e91bc08062b6c996b79fb148b8cf0303.tar.bz2 |
Issue #21376: document asyncio.TimeoutError
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/library/asyncio-task.rst | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/Doc/library/asyncio-task.rst b/Doc/library/asyncio-task.rst index 4e5526e..67eaccd 100644 --- a/Doc/library/asyncio-task.rst +++ b/Doc/library/asyncio-task.rst @@ -142,6 +142,18 @@ InvalidStateError The operation is not allowed in this state. +TimeoutError +------------ + +.. exception:: TimeoutError + + The operation exceeded the given deadline. + +.. note:: + + This exception is different from the builtin :exc:`TimeoutError` exception! + + Future ------ @@ -400,7 +412,8 @@ Task functions Return an iterator whose values, when waited for, are :class:`Future` instances. - Raises :exc:`TimeoutError` if the timeout occurs before all Futures are done. + Raises :exc:`asyncio.TimeoutError` if the timeout occurs before all Futures + are done. Example:: @@ -521,8 +534,8 @@ Task functions .. note:: - This does not raise :exc:`TimeoutError`! Futures that aren't done when - the timeout occurs are returned in the second set. + This does not raise :exc:`asyncio.TimeoutError`! Futures that aren't done + when the timeout occurs are returned in the second set. .. function:: wait_for(fut, timeout, \*, loop=None) @@ -534,7 +547,7 @@ Task functions Coroutine will be wrapped in :class:`Task`. Returns result of the Future or coroutine. When a timeout occurs, it - cancels the task and raises :exc:`TimeoutError`. To avoid the task + cancels the task and raises :exc:`asyncio.TimeoutError`. To avoid the task cancellation, wrap it in :func:`shield`. This function is a :ref:`coroutine <coroutine>`. |