mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
Issue #23095, asyncio: IocpProactor.close() must not cancel pending
_WaitCancelFuture futures
This commit is contained in:
parent
0c2e408833
commit
1ca9392c70
1 changed files with 6 additions and 0 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue