summaryrefslogtreecommitdiffstats
path: root/Lib/asyncio/windows_events.py
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2015-01-22 21:47:13 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2015-01-22 21:47:13 (GMT)
commit752aba7f999b08c833979464a36840de8be0baf0 (patch)
tree7852904811f1717c940c6301e0144f94316925cc /Lib/asyncio/windows_events.py
parentf6228f02d70197cd876f608b8caf69a6b5211468 (diff)
downloadcpython-752aba7f999b08c833979464a36840de8be0baf0.zip
cpython-752aba7f999b08c833979464a36840de8be0baf0.tar.gz
cpython-752aba7f999b08c833979464a36840de8be0baf0.tar.bz2
asyncio: IocpProactor.close() doesn't cancel anymore futures which are already
cancelled
Diffstat (limited to 'Lib/asyncio/windows_events.py')
-rw-r--r--Lib/asyncio/windows_events.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/Lib/asyncio/windows_events.py b/Lib/asyncio/windows_events.py
index 3cb5690f..315455a 100644
--- a/Lib/asyncio/windows_events.py
+++ b/Lib/asyncio/windows_events.py
@@ -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()