diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2015-01-22 00:15:53 +0100 |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2015-01-22 00:15:53 +0100 |
commit | 5d7bbcf567230dcfa8a419b1a0d462566c65ab83 (patch) | |
tree | 867b68be345d780ce76aa5d2eda6d2362e00a6b1 | |
parent | 4f99b2f089c0c8f33b0cfd5c7d41f774579bcd39 (diff) | |
download | trollius-5d7bbcf567230dcfa8a419b1a0d462566c65ab83.tar.gz |
Python issue #23095: IocpProactor.close() must not cancel pending
_WaitCancelFuture futures
-rw-r--r-- | asyncio/windows_events.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/asyncio/windows_events.py b/asyncio/windows_events.py index 5105426..3cb5690 100644 --- a/asyncio/windows_events.py +++ b/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() |