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

cancelled
This commit is contained in:
Victor Stinner 2015-01-22 22:47:13 +01:00
parent f6228f02d7
commit 752aba7f99
1 changed files with 7 additions and 3 deletions

View File

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