Commit a661392f authored by Victor Stinner's avatar Victor Stinner Committed by GitHub

bpo-37531: regrtest now catchs ProcessLookupError (GH-16827)

Fix a warning on a race condition on TestWorkerProcess.kill(): ignore
silently ProcessLookupError rather than logging an useless warning.
parent 7aebbd11
......@@ -152,6 +152,11 @@ class TestWorkerProcess(threading.Thread):
print(f"Kill {self}", file=sys.stderr, flush=True)
try:
popen.kill()
except ProcessLookupError:
# Process completed, the TestWorkerProcess thread read its exit
# status, but Popen.send_signal() read the returncode just before
# Popen.wait() set returncode.
pass
except OSError as exc:
print_warning(f"Failed to kill {self}: {exc!r}")
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment