Sends SIGKILL to |process| and kills child processes if |kill_children|.
(wrapped_process: WrappedPopen, kill_children: bool)
| 39 | |
| 40 | |
| 41 | def _end_process(wrapped_process: WrappedPopen, kill_children: bool): |
| 42 | """Sends SIGKILL to |process| and kills child processes if |
| 43 | |kill_children|.""" |
| 44 | try: |
| 45 | process_group_id = os.getpgid(wrapped_process.process.pid) |
| 46 | except ProcessLookupError: |
| 47 | process_group_id = None |
| 48 | |
| 49 | wrapped_process.process.kill() |
| 50 | wrapped_process.timed_out = True |
| 51 | if kill_children and process_group_id is not None: |
| 52 | _kill_process_group(process_group_id) |
| 53 | |
| 54 | |
| 55 | def _start_kill_thread(process: WrappedPopen, kill_children: bool, |
nothing calls this directly
no test coverage detected