[Python-checkins] bpo-37531: Fix regrtest _timedout() function on timeout (GH-15419)

Victor Stinner webhook-mailer at python.org
Fri Aug 23 06:27:28 EDT 2019


https://github.com/python/cpython/commit/767434c39c8f3c6a8af1b3282d8382ccf809fe21
commit: 767434c39c8f3c6a8af1b3282d8382ccf809fe21
branch: master
author: Victor Stinner <vstinner at redhat.com>
committer: GitHub <noreply at github.com>
date: 2019-08-23T11:27:24+01:00
summary:

bpo-37531: Fix regrtest _timedout() function on timeout (GH-15419)

Fix code handling TimeoutExpired exception in _timedout().

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 c22479b7976f..c5ac6e090376 100644
--- a/Lib/test/libregrtest/runtest_mp.py
+++ b/Lib/test/libregrtest/runtest_mp.py
@@ -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()



More information about the Python-checkins mailing list