mirror of
https://github.com/python/cpython.git
synced 2025-09-27 02:39:58 +00:00
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
2 changed files with 3 additions and 1 deletions
|
@ -495,10 +495,11 @@ async def _wait(fs, timeout, return_when, loop):
|
||||||
finally:
|
finally:
|
||||||
if timeout_handle is not None:
|
if timeout_handle is not None:
|
||||||
timeout_handle.cancel()
|
timeout_handle.cancel()
|
||||||
|
for f in fs:
|
||||||
|
f.remove_done_callback(_on_completion)
|
||||||
|
|
||||||
done, pending = set(), set()
|
done, pending = set(), set()
|
||||||
for f in fs:
|
for f in fs:
|
||||||
f.remove_done_callback(_on_completion)
|
|
||||||
if f.done():
|
if f.done():
|
||||||
done.add(f)
|
done.add(f)
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
Fix :mod:`asyncio` wait() not removing callback if exception
|
Loading…
Add table
Add a link
Reference in a new issue