From: Victor Stinner Date: Fri, 5 May 2017 08:28:35 +0000 (+0200) Subject: bpo-30258: Fix handling of child error in regrtest (#1477) X-Git-Tag: v2.7.14rc1~166 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=228da42961ac9bf2990e6c191ecc9b762ead617c;p=python bpo-30258: Fix handling of child error in regrtest (#1477) Don't stop the worker thread if a child failed. --- diff --git a/Lib/test/regrtest.py b/Lib/test/regrtest.py index 413d7f9064..9874dded97 100755 --- a/Lib/test/regrtest.py +++ b/Lib/test/regrtest.py @@ -555,16 +555,16 @@ def main(tests=None, testdir=None, verbose=0, quiet=False, # comes from the shutdown of the interpreter in the subcommand. stderr = debug_output_pat.sub("", stderr) - if retcode != 0: + if retcode == 0: + stdout, _, result = stdout.strip().rpartition("\n") + if not result: + output.put((None, None, None, None)) + return + + result = json.loads(result) + else: result = (CHILD_ERROR, "Exit code %s" % retcode) - output.put((test, stdout.rstrip(), stderr.rstrip(), - result)) - stdout, _, result = stdout.strip().rpartition("\n") - if not result: - output.put((None, None, None, None)) - return - result = json.loads(result) output.put((test, stdout.rstrip(), stderr.rstrip(), result)) except BaseException: output.put((None, None, None, None))