diff options
| author | Vladimir Matveev <v2matveev@outlook.com> | 2018-12-18 13:56:17 -0800 |
|---|---|---|
| committer | Andrew Svetlov <andrew.svetlov@gmail.com> | 2018-12-18 23:56:17 +0200 |
| commit | b5c8cfa1da17c6f3acac80a0afca7f7104fb9589 (patch) | |
| tree | d725abe7cb749e02672c269d7edc7bbcfd8faab6 /Lib/asyncio/windows_events.py | |
| parent | e3666fc8effb05b555121f4ab7388df59e21f8b4 (diff) | |
| download | cpython-git-b5c8cfa1da17c6f3acac80a0afca7f7104fb9589.tar.gz | |
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.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Lib/asyncio/windows_events.py b/Lib/asyncio/windows_events.py index 772ddf4dfe..33ffaf9717 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 |
