]> granicus.if.org Git - python/commitdiff
Issue #23293, asyncio: Cleanup IocpProactor.close()
authorVictor Stinner <victor.stinner@gmail.com>
Mon, 26 Jan 2015 10:02:59 +0000 (11:02 +0100)
committerVictor Stinner <victor.stinner@gmail.com>
Mon, 26 Jan 2015 10:02:59 +0000 (11:02 +0100)
The special case for connect_pipe() is not more needed. connect_pipe() doesn't
use overlapped operations anymore.

Lib/asyncio/windows_events.py

index 42c5f6e1a47e3a189ba38c3e4d24e817ea0bf55e..6c7e0580422b0e573a7d1de9eff38be462deb885 100644 (file)
@@ -694,12 +694,7 @@ class IocpProactor:
     def close(self):
         # Cancel remaining registered operations.
         for address, (fut, ov, obj, callback) in list(self._cache.items()):
-            if obj is None:
-                # The operation was started with connect_pipe() which
-                # queues a task to Windows' thread pool.  This cannot
-                # be cancelled, so just forget it.
-                del self._cache[address]
-            elif fut.cancelled():
+            if fut.cancelled():
                 # Nothing to do with cancelled futures
                 pass
             elif isinstance(fut, _WaitCancelFuture):