mirror of
https://github.com/python/cpython.git
synced 2026-01-08 08:22:41 +00:00
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.
This commit is contained in:
parent
7aebbd1182
commit
a661392f8f
1 changed files with 5 additions and 0 deletions
|
|
@ -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}")
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue