summaryrefslogtreecommitdiffstats
path: root/Lib/asyncio/windows_events.py
diff options
context:
space:
mode:
authorVladimir Matveev <v2matveev@outlook.com>2018-12-18 21:56:17 (GMT)
committerAndrew Svetlov <andrew.svetlov@gmail.com>2018-12-18 21:56:17 (GMT)
commitb5c8cfa1da17c6f3acac80a0afca7f7104fb9589 (patch)
treed725abe7cb749e02672c269d7edc7bbcfd8faab6 /Lib/asyncio/windows_events.py
parente3666fc8effb05b555121f4ab7388df59e21f8b4 (diff)
downloadcpython-b5c8cfa1da17c6f3acac80a0afca7f7104fb9589.zip
cpython-b5c8cfa1da17c6f3acac80a0afca7f7104fb9589.tar.gz
cpython-b5c8cfa1da17c6f3acac80a0afca7f7104fb9589.tar.bz2
bpo-23057: add loop self socket as wakeup fd for signals (#11135)
Diffstat (limited to 'Lib/asyncio/windows_events.py')
-rw-r--r--Lib/asyncio/windows_events.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/Lib/asyncio/windows_events.py b/Lib/asyncio/windows_events.py
index 772ddf4..33ffaf9 100644
--- a/Lib/asyncio/windows_events.py
+++ b/Lib/asyncio/windows_events.py
@@ -308,6 +308,16 @@ class ProactorEventLoop(proactor_events.BaseProactorEventLoop):
proactor = IocpProactor()
super().__init__(proactor)
+ def run_forever(self):
+ try:
+ assert self._self_reading_future is None
+ self.call_soon(self._loop_self_reading)
+ super().run_forever()
+ finally:
+ if self._self_reading_future is not None:
+ self._self_reading_future.cancel()
+ self._self_reading_future = None
+
async def create_pipe_connection(self, protocol_factory, address):
f = self._proactor.connect_pipe(address)
pipe = await f