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

Function _check_process_died

Lib/profiling/sampling/cli.py:202–217  ·  view source on GitHub ↗

Check if process died and raise an error with stderr if available.

(process)

Source from the content-addressed store, hash-verified

200
201
202def _check_process_died(process):
203 """Check if process died and raise an error with stderr if available."""
204 if process.poll() is None:
205 return
206
207 # Process died - try to get stderr for error message
208 stderr_msg = ""
209 if process.stderr:
210 try:
211 stderr_msg = process.stderr.read().decode().strip()
212 except (OSError, UnicodeDecodeError):
213 pass
214
215 if stderr_msg:
216 raise RuntimeError(stderr_msg)
217 raise RuntimeError(f"Process exited with code {process.returncode}")
218
219
220def _wait_for_ready_signal(sync_sock, process, timeout):

Callers 1

_wait_for_ready_signalFunction · 0.85

Calls 4

pollMethod · 0.45
stripMethod · 0.45
decodeMethod · 0.45
readMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…