More defensive process killing. Closes #2629.

pull/2651/merge
Jussi Pakkanen 7 years ago
parent 638077181a
commit 5cd8a7bbcc
  1. 8
      mesonbuild/mtest.py

@ -267,7 +267,13 @@ class TestHarness:
if is_windows():
subprocess.call(['taskkill', '/F', '/T', '/PID', str(p.pid)])
else:
os.killpg(os.getpgid(p.pid), signal.SIGKILL)
try:
os.killpg(os.getpgid(p.pid), signal.SIGKILL)
except ProcessLookupError:
# Sometimes (e.g. with Wine) this happens.
# There's nothing we can do (maybe the process
# already died) so carry on.
pass
(stdo, stde) = p.communicate()
endtime = time.time()
duration = endtime - starttime

Loading…
Cancel
Save