(pid: int, sig: int)
| 46 | |
| 47 | |
| 48 | def _kill_process_group(pid: int, sig: int) -> None: |
| 49 | try: |
| 50 | if _sys_mod.platform == "win32": |
| 51 | # No setpgid on Windows; just kill the process itself. |
| 52 | _os_mod.kill(pid, sig) |
| 53 | else: |
| 54 | _os_mod.killpg(_os_mod.getpgid(pid), sig) |
| 55 | except (ProcessLookupError, PermissionError, OSError): |
| 56 | # Already gone (race vs. natural exit) or insufficient |
| 57 | # privileges — fall through to subprocess.wait() which will |
| 58 | # surface the right state. |
| 59 | pass |
| 60 | |
| 61 | |
| 62 | def _run_bash_with_abort( |
no test coverage detected