Skip to content

Commit a661392

Browse files
authored
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.
1 parent 7aebbd1 commit a661392

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Lib/test/libregrtest/runtest_mp.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,11 @@ def _kill(self):
152152
print(f"Kill {self}", file=sys.stderr, flush=True)
153153
try:
154154
popen.kill()
155+
except ProcessLookupError:
156+
# Process completed, the TestWorkerProcess thread read its exit
157+
# status, but Popen.send_signal() read the returncode just before
158+
# Popen.wait() set returncode.
159+
pass
155160
except OSError as exc:
156161
print_warning(f"Failed to kill {self}: {exc!r}")
157162

0 commit comments

Comments
 (0)