Check if process died and raise an error with stderr if available.
(process)
| 200 | |
| 201 | |
| 202 | def _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 | |
| 220 | def _wait_for_ready_signal(sync_sock, process, timeout): |
no test coverage detected
searching dependent graphs…