From abd9a8ecafd975072513e60ec94e4d69d789cc6a Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Fri, 5 May 2017 10:19:14 +0200 Subject: [PATCH] bpo-30258: Fix handling of child error in regrtest Don't stop the worker thread if a child failed. --- Lib/test/regrtest.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Lib/test/regrtest.py b/Lib/test/regrtest.py index 413d7f90649074..9874dded97ad42 100755 --- a/Lib/test/regrtest.py +++ b/Lib/test/regrtest.py @@ -555,16 +555,16 @@ def work(): # 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))