summaryrefslogtreecommitdiffstats
path: root/Lib/asyncio
diff options
context:
space:
mode:
authorVladimir Matveev <v2matveev@outlook.com>2019-01-05 20:44:59 (GMT)
committerAndrew Svetlov <andrew.svetlov@gmail.com>2019-01-05 20:44:59 (GMT)
commit67ba547cf001d6b975cf6900aaf2bd5508dc6a87 (patch)
tree685204876ea4058b9ea805b14a30a9177b41714d /Lib/asyncio
parent31ec52a9afedd77e36a3ddc31c4c45664b8ac410 (diff)
downloadcpython-67ba547cf001d6b975cf6900aaf2bd5508dc6a87.zip
cpython-67ba547cf001d6b975cf6900aaf2bd5508dc6a87.tar.gz
cpython-67ba547cf001d6b975cf6900aaf2bd5508dc6a87.tar.bz2
bpo-23057: Use 'raise' to emulate ctrl-c in proactor tests (#11274)
Diffstat (limited to 'Lib/asyncio')
-rw-r--r--Lib/asyncio/windows_events.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/Lib/asyncio/windows_events.py b/Lib/asyncio/windows_events.py
index 33ffaf9..0f3e9f4 100644
--- a/Lib/asyncio/windows_events.py
+++ b/Lib/asyncio/windows_events.py
@@ -315,7 +315,12 @@ class ProactorEventLoop(proactor_events.BaseProactorEventLoop):
super().run_forever()
finally:
if self._self_reading_future is not None:
+ ov = self._self_reading_future._ov
self._self_reading_future.cancel()
+ # self_reading_future was just cancelled so it will never be signalled
+ # Unregister it otherwise IocpProactor.close will wait for it forever
+ if ov is not None:
+ self._proactor._unregister(ov)
self._self_reading_future = None
async def create_pipe_connection(self, protocol_factory, address):