(proc)
| 79 | |
| 80 | |
| 81 | def reap(proc): |
| 82 | if proc.poll() is not None: |
| 83 | return None |
| 84 | try: |
| 85 | proc.terminate() |
| 86 | except OSError: |
| 87 | pass |
| 88 | try: |
| 89 | proc.wait(timeout=REAP_SECONDS) |
| 90 | return None |
| 91 | except subprocess.TimeoutExpired: |
| 92 | pass |
| 93 | try: |
| 94 | proc.kill() |
| 95 | proc.wait(timeout=REAP_SECONDS) |
| 96 | return None |
| 97 | except (OSError, subprocess.TimeoutExpired): |
| 98 | return "owned child did not terminate after kill" |
| 99 | |
| 100 | |
| 101 | def run_process(directory, label, argv, environment): |
no test coverage detected