]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
bpo-40607: Reraise exception during task cancelation in asyncio.wait_for() (GH-20054)
authorromasku <romasku135@gmail.com>
Fri, 15 May 2020 20:12:05 +0000 (23:12 +0300)
committerGitHub <noreply@github.com>
Fri, 15 May 2020 20:12:05 +0000 (13:12 -0700)
commit382a5635bd10c237c3e23e346b21cde27e48d7fa
treeaeafbddb7b6a726cb148345269719c79043354d7
parentc087a268a4d4ead8ef2ca21e325423818729da89
bpo-40607: Reraise exception during task cancelation in asyncio.wait_for() (GH-20054)

Currently, if asyncio.wait_for() timeout expires, it cancels
inner future and then always raises TimeoutError. In case
those future is task, it can handle cancelation mannually,
and those process can lead to some other exception. Current
implementation silently loses thoses exception.

To resolve this, wait_for will check was the cancelation
successfull or not. In case there was exception, wait_for
will reraise it.

Co-authored-by: Roman Skurikhin <roman.skurikhin@cruxlab.com>
Doc/library/asyncio-task.rst
Lib/asyncio/tasks.py
Lib/test/test_asyncio/test_tasks.py
Misc/ACKS
Misc/NEWS.d/next/Library/2020-05-13-15-32-13.bpo-40607.uSPFCi.rst [new file with mode: 0644]