MCPcopy Index your code
hub / github.com/python/cpython / _run_forever_cleanup

Method _run_forever_cleanup

Lib/asyncio/windows_events.py:323–336  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

321 super()._run_forever_setup()
322
323 def _run_forever_cleanup(self):
324 super()._run_forever_cleanup()
325 if self._self_reading_future is not None:
326 ov = self._self_reading_future._ov
327 self._self_reading_future.cancel()
328 # self_reading_future always uses IOCP, so even though it's
329 # been cancelled, we need to make sure that the IOCP message
330 # is received so that the kernel is not holding on to the
331 # memory, possibly causing memory corruption later. Only
332 # unregister it if IO is complete in all respects. Otherwise
333 # we need another _poll() later to complete the IO.
334 if ov is not None and not ov.pending:
335 self._proactor._unregister(ov)
336 self._self_reading_future = None
337
338 async def create_pipe_connection(self, protocol_factory, address):
339 f = self._proactor.connect_pipe(address)

Callers

nothing calls this directly

Calls 3

superClass · 0.85
_unregisterMethod · 0.80
cancelMethod · 0.45

Tested by

no test coverage detected