mirror of
https://github.com/python/cpython.git
synced 2024-11-24 10:24:35 +08:00
bpo-37531: Fix regrtest _timedout() function on timeout (GH-15419)
Fix code handling TimeoutExpired exception in _timedout().
This commit is contained in:
parent
c48682509d
commit
767434c39c
@ -184,14 +184,14 @@ class MultiprocessThread(threading.Thread):
|
||||
def _timedout(self, test_name):
|
||||
self._kill()
|
||||
|
||||
stdout = sterr = ''
|
||||
stdout = stderr = ''
|
||||
popen = self._popen
|
||||
try:
|
||||
stdout, stderr = popen.communicate(timeout=JOIN_TIMEOUT)
|
||||
except (subprocess.TimeoutExpired, OSError) as exc:
|
||||
print("WARNING: Failed to read worker process %s output "
|
||||
"(timeout=%.1f sec): %r"
|
||||
% (popen.pid, exc, timeout),
|
||||
% (popen.pid, JOIN_TIMEOUT, exc),
|
||||
file=sys.stderr, flush=True)
|
||||
|
||||
self._close_wait()
|
||||
|
Loading…
Reference in New Issue
Block a user