(pid: int, sig: int)
| 91 | |
| 92 | |
| 93 | def _kill_process_group(pid: int, sig: int) -> None: |
| 94 | try: |
| 95 | if sys.platform == "win32": |
| 96 | os.kill(pid, sig) |
| 97 | else: |
| 98 | os.killpg(os.getpgid(pid), sig) |
| 99 | except (ProcessLookupError, PermissionError, OSError): |
| 100 | # Already gone (race vs. natural exit) or insufficient privileges |
| 101 | # — fall through to ``proc.wait()`` which will surface the right |
| 102 | # state. |
| 103 | pass |
| 104 | |
| 105 | |
| 106 | def _run_rg_with_abort( |
no test coverage detected