[Python-checkins] bpo-37531: regrtest now catchs ProcessLookupError (GH-16827)
Victor Stinner
webhook-mailer at python.org
Wed Oct 16 18:29:19 EDT 2019
https://github.com/python/cpython/commit/a661392f8fb5ac4fc095aa1845d1eb7a25c4e9be
commit: a661392f8fb5ac4fc095aa1845d1eb7a25c4e9be
branch: master
author: Victor Stinner <vstinner at python.org>
committer: GitHub <noreply at github.com>
date: 2019-10-17T00:29:12+02:00
summary:
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.
files:
M Lib/test/libregrtest/runtest_mp.py
diff --git a/Lib/test/libregrtest/runtest_mp.py b/Lib/test/libregrtest/runtest_mp.py
index 71db8d6966859..8026de187d587 100644
--- a/Lib/test/libregrtest/runtest_mp.py
+++ b/Lib/test/libregrtest/runtest_mp.py
@@ -152,6 +152,11 @@ def _kill(self):
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}")
More information about the Python-checkins
mailing list