Commit c1964e9e authored by gescheit's avatar gescheit Committed by Miss Islington (bot)

bpo-36613: call remove_done_callback if exception (GH-12800)



Call remove_done_callback() in finally block.


https://bugs.python.org/issue36613
parent 4461d704
......@@ -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:
......
Fix :mod:`asyncio` wait() not removing callback if exception
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment