Skip to content

Commit

Permalink
bpo-37531: Fix regrtest _timedout() function on timeout (pythonGH-15419)
Browse files Browse the repository at this point in the history
Fix code handling TimeoutExpired exception in _timedout().
  • Loading branch information
vstinner authored and lisroach committed Sep 9, 2019
1 parent c772420 commit 0f36fd3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Lib/test/libregrtest/runtest_mp.py
Expand Up @@ -184,14 +184,14 @@ def mp_result_error(self, test_name, error_type, stdout='', stderr='',
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()
Expand Down

0 comments on commit 0f36fd3

Please sign in to comment.