diff options
author | gescheit <gescheit12@gmail.com> | 2019-05-03 15:18:02 (GMT) |
---|---|---|
committer | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2019-05-03 15:18:02 (GMT) |
commit | c1964e9e2177eabe821f3e4243be8b99e0d2d542 (patch) | |
tree | 7390706509d540575ca8d89c9d3c7d0973e20165 /Lib/asyncio | |
parent | 4461d704e23a13dfbe78ea3020e4cbeff4b68dc2 (diff) | |
download | cpython-c1964e9e2177eabe821f3e4243be8b99e0d2d542.zip cpython-c1964e9e2177eabe821f3e4243be8b99e0d2d542.tar.gz cpython-c1964e9e2177eabe821f3e4243be8b99e0d2d542.tar.bz2 |
bpo-36613: call remove_done_callback if exception (GH-12800)
Call remove_done_callback() in finally block.
https://bugs.python.org/issue36613
Diffstat (limited to 'Lib/asyncio')
-rw-r--r-- | Lib/asyncio/tasks.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/asyncio/tasks.py b/Lib/asyncio/tasks.py index d850837..007a459 100644 --- a/Lib/asyncio/tasks.py +++ b/Lib/asyncio/tasks.py @@ -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: |