[Python-checkins] cpython: regrtest: give more information when a child process fails with an error
victor.stinner
python-checkins at python.org
Wed Aug 8 22:41:13 CEST 2012
http://hg.python.org/cpython/rev/85266c6f9ae4
changeset: 78465:85266c6f9ae4
user: Victor Stinner <victor.stinner at gmail.com>
date: Wed Aug 08 22:37:26 2012 +0200
summary:
regrtest: give more information when a child process fails with an error
different than KeyboardInterrupt
files:
Lib/test/regrtest.py | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/Lib/test/regrtest.py b/Lib/test/regrtest.py
--- a/Lib/test/regrtest.py
+++ b/Lib/test/regrtest.py
@@ -440,8 +440,11 @@
args, kwargs = json.loads(a)
try:
result = runtest(*args, **kwargs)
+ except KeyboardInterrupt:
+ result = INTERRUPTED, ''
except BaseException as e:
- result = INTERRUPTED, e.__class__.__name__
+ traceback.print_exc()
+ result = CHILD_ERROR, str(e)
sys.stdout.flush()
print() # Force a newline (just in case)
print(json.dumps(result))
@@ -684,8 +687,7 @@
sys.stdout.flush()
sys.stderr.flush()
if result[0] == INTERRUPTED:
- assert result[1] == 'KeyboardInterrupt'
- raise KeyboardInterrupt # What else?
+ raise KeyboardInterrupt
if result[0] == CHILD_ERROR:
raise Exception("Child error on {}: {}".format(test, result[1]))
test_index += 1
--
Repository URL: http://hg.python.org/cpython
More information about the Python-checkins
mailing list