Commit 752aba7f authored by Victor Stinner's avatar Victor Stinner

asyncio: IocpProactor.close() doesn't cancel anymore futures which are already

cancelled
parent f6228f02
...@@ -693,12 +693,16 @@ class IocpProactor: ...@@ -693,12 +693,16 @@ class IocpProactor:
# queues a task to Windows' thread pool. This cannot # queues a task to Windows' thread pool. This cannot
# be cancelled, so just forget it. # be cancelled, so just forget it.
del self._cache[address] del self._cache[address]
# FIXME: Tulip issue 196: remove this case, it should not happen elif fut.cancelled():
elif fut.done() and not fut.cancelled(): # Nothing to do with cancelled futures
del self._cache[address] pass
elif isinstance(fut, _WaitCancelFuture): elif isinstance(fut, _WaitCancelFuture):
# _WaitCancelFuture must not be cancelled # _WaitCancelFuture must not be cancelled
pass pass
elif fut.done():
# FIXME: Tulip issue 196: remove this case, it should not
# happen
del self._cache[address]
else: else:
try: try:
fut.cancel() fut.cancel()
......
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