diff options
author | Andrew Svetlov <andrew.svetlov@gmail.com> | 2022-03-10 16:05:20 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-10 16:05:20 (GMT) |
commit | f537b2a4fb86445ee3bd6ca7f10bc9d3a9f37da5 (patch) | |
tree | d67041f2121c19f1ba0a6a723a8aeccb771d3614 /Misc | |
parent | 32bf3597922ac3f613989582afa2bff43bea8a2f (diff) | |
download | cpython-f537b2a4fb86445ee3bd6ca7f10bc9d3a9f37da5.zip cpython-f537b2a4fb86445ee3bd6ca7f10bc9d3a9f37da5.tar.gz cpython-f537b2a4fb86445ee3bd6ca7f10bc9d3a9f37da5.tar.bz2 |
bpo-46771: Implement asyncio context managers for handling timeouts (GH-31394)
Example:
async with asyncio.timeout(5):
await some_task()
Will interrupt the await and raise TimeoutError if some_task() takes longer than 5 seconds.
Co-authored-by: Guido van Rossum <guido@python.org>
Diffstat (limited to 'Misc')
-rw-r--r-- | Misc/NEWS.d/next/Library/2022-02-21-11-41-23.bpo-464471.fL06TV.rst | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Misc/NEWS.d/next/Library/2022-02-21-11-41-23.bpo-464471.fL06TV.rst b/Misc/NEWS.d/next/Library/2022-02-21-11-41-23.bpo-464471.fL06TV.rst new file mode 100644 index 0000000..b8a48d6 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2022-02-21-11-41-23.bpo-464471.fL06TV.rst @@ -0,0 +1,2 @@ +:func:`asyncio.timeout` and :func:`asyncio.timeout_at` context managers +added. Patch by Tin Tvrtković and Andrew Svetlov. |