杀死进程树 — 不只是主进程,还有所有子进程
(self, pid: int)
| 710 | return 0, False |
| 711 | |
| 712 | def kill_process_tree(self, pid: int): |
| 713 | """杀死进程树 — 不只是主进程,还有所有子进程""" |
| 714 | try: |
| 715 | os.killpg(os.getpgid(pid), signal.SIGKILL) |
| 716 | except (ProcessLookupError, PermissionError): |
| 717 | pass |
| 718 | |
| 719 | wd = OutputWatchdog("/tmp/example-output.txt", MAX_OUTPUT_SIZE) |
| 720 | print(f" 最大输出: {MAX_OUTPUT_SIZE / 1024 / 1024:.0f}MB") |
nothing calls this directly
no outgoing calls
no test coverage detected