diff options
author | Victor Stinner <victor.stinner@haypocalc.com> | 2011-05-22 13:27:14 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@haypocalc.com> | 2011-05-22 13:27:14 (GMT) |
commit | 3c18f259eeb150c078b282728e9730733fcdcf4b (patch) | |
tree | 38c94016adf4f78d4615700d1cb20d8f12fab3d9 | |
parent | b455e58b95a6603f8464f6de4474c160a8f83047 (diff) | |
download | cpython-3c18f259eeb150c078b282728e9730733fcdcf4b.zip cpython-3c18f259eeb150c078b282728e9730733fcdcf4b.tar.gz cpython-3c18f259eeb150c078b282728e9730733fcdcf4b.tar.bz2 |
regrtest: enable faulthandler in main() instead of if __name__ == '__main__':
So it's also enabled when using "./python -m test".
-rwxr-xr-x | Lib/test/regrtest.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/Lib/test/regrtest.py b/Lib/test/regrtest.py index 120bd60..2a08de4 100755 --- a/Lib/test/regrtest.py +++ b/Lib/test/regrtest.py @@ -265,6 +265,10 @@ def main(tests=None, testdir=None, verbose=0, quiet=False, directly to set the values that would normally be set by flags on the command line. """ + + # Display the Python traceback fatal errors (e.g. segfault) + faulthandler.enable(all_threads=True) + if hasattr(faulthandler, 'dump_tracebacks_later'): timeout = 60*60 else: @@ -1588,9 +1592,6 @@ def _make_temp_dir_for_build(TEMPDIR): return TEMPDIR, TESTCWD if __name__ == '__main__': - # Display the Python traceback on segfault and division by zero - faulthandler.enable(all_threads=True) - # Remove regrtest.py's own directory from the module search path. Despite # the elimination of implicit relative imports, this is still needed to # ensure that submodules of the test package do not inappropriately appear |