From: Victor Stinner Date: Wed, 21 Jan 2015 23:17:54 +0000 (+0100) Subject: Issue #23095, asyncio: IocpProactor.close() must not cancel pending X-Git-Tag: v3.4.3rc1~103 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1ca9392c7083972c1953c02e6f2cca54934ce0a6;p=python Issue #23095, asyncio: IocpProactor.close() must not cancel pending _WaitCancelFuture futures --- diff --git a/Lib/asyncio/windows_events.py b/Lib/asyncio/windows_events.py index 5105426f0d..3cb5690f8e 100644 --- a/Lib/asyncio/windows_events.py +++ b/Lib/asyncio/windows_events.py @@ -163,6 +163,9 @@ class _WaitCancelFuture(_BaseWaitHandleFuture): self._done_callback = None + def cancel(self): + raise RuntimeError("_WaitCancelFuture must not be cancelled") + def _schedule_callbacks(self): super(_WaitCancelFuture, self)._schedule_callbacks() if self._done_callback is not None: @@ -693,6 +696,9 @@ class IocpProactor: # FIXME: Tulip issue 196: remove this case, it should not happen elif fut.done() and not fut.cancelled(): del self._cache[address] + elif isinstance(fut, _WaitCancelFuture): + # _WaitCancelFuture must not be cancelled + pass else: try: fut.cancel()