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

Method _try_finish

Lib/asyncio/base_subprocess.py:257–273  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

255 return await waiter
256
257 def _try_finish(self):
258 assert not self._finished
259 if self._returncode is None:
260 return
261 if not self._pipes_connected:
262 # self._pipes_connected can be False if not all pipes were connected
263 # because either the process failed to start or the self._connect_pipes task
264 # got cancelled. In this broken state we consider all pipes disconnected and
265 # to avoid hanging forever in self._wait as otherwise _exit_waiters
266 # would never be woken up, we wake them up here.
267 for waiter in self._exit_waiters:
268 if not waiter.done():
269 waiter.set_result(self._returncode)
270 if all(p is not None and p.disconnected
271 for p in self._pipes.values()):
272 self._finished = True
273 self._call(self._call_connection_lost, None)
274
275 def _call_connection_lost(self, exc):
276 try:

Callers 2

_pipe_connection_lostMethod · 0.95
_process_exitedMethod · 0.95

Calls 4

_callMethod · 0.95
doneMethod · 0.45
set_resultMethod · 0.45
valuesMethod · 0.45

Tested by

no test coverage detected