(proc: Optional[subprocess.Popen[str]])
| 188 | |
| 189 | |
| 190 | def _terminate_process(proc: Optional[subprocess.Popen[str]]) -> None: |
| 191 | if proc is None: |
| 192 | return |
| 193 | if proc.poll() is None: |
| 194 | proc.terminate() |
| 195 | try: |
| 196 | proc.wait(timeout=10) |
| 197 | except subprocess.TimeoutExpired: |
| 198 | proc.kill() |
| 199 | proc.wait(timeout=10) |
| 200 | if proc.stdout is not None: |
| 201 | proc.stdout.read() |
| 202 | if proc.stderr is not None: |
| 203 | proc.stderr.read() |
| 204 | |
| 205 | |
| 206 | def _observe_status(module, label: str) -> dict: |
no test coverage detected