mirror of https://github.com/python/cpython
bpo-36613: call remove_done_callback if exception (GH-12800)
Call remove_done_callback() in finally block. https://bugs.python.org/issue36613
This commit is contained in:
parent
4461d704e2
commit
c1964e9e21
|
@ -495,10 +495,11 @@ async def _wait(fs, timeout, return_when, loop):
|
|||
finally:
|
||||
if timeout_handle is not None:
|
||||
timeout_handle.cancel()
|
||||
for f in fs:
|
||||
f.remove_done_callback(_on_completion)
|
||||
|
||||
done, pending = set(), set()
|
||||
for f in fs:
|
||||
f.remove_done_callback(_on_completion)
|
||||
if f.done():
|
||||
done.add(f)
|
||||
else:
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
Fix :mod:`asyncio` wait() not removing callback if exception
|
Loading…
Reference in New Issue