]> granicus.if.org Git - python/commitdiff
bpo-37531: Fix regrtest _timedout() function on timeout (GH-15419)
authorVictor Stinner <vstinner@redhat.com>
Fri, 23 Aug 2019 10:27:24 +0000 (11:27 +0100)
committerGitHub <noreply@github.com>
Fri, 23 Aug 2019 10:27:24 +0000 (11:27 +0100)
Fix code handling TimeoutExpired exception in _timedout().

Lib/test/libregrtest/runtest_mp.py

index c22479b7976f000012f812043de1be6403fdd279..c5ac6e090376bfd0473ed59f40d9d265c195e51b 100644 (file)
@@ -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()