[Python-Dev] cpython: Issue #12550: regrtest displays the Python traceback on SIGALRM or SIGUSR1 (original) (raw)
Georg Brandl g.brandl at gmx.net
Thu Jul 14 13:33:32 CEST 2011
- Previous message: [Python-Dev] Failed to install PIL on windows, may have something to do with python implementaton
- Next message: [Python-Dev] cpython: Issue #12550: regrtest displays the Python traceback on SIGALRM or SIGUSR1
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Would it make sense to not propagate the signal in one case (e.g. SIGUSR1), i.e. just display the traceback in this case?
Georg
Am 13.07.2011 23:49, schrieb victor.stinner:
http://hg.python.org/cpython/rev/30f91fbfc8b3 changeset: 71315:30f91fbfc8b3 user: Victor Stinner <victor.stinner at haypocalc.com> date: Wed Jul 13 23:47:21 2011 +0200 summary: Issue #12550: regrtest displays the Python traceback on SIGALRM or SIGUSR1
files: Lib/test/regrtest.py | 12 +++++++++++- 1 files changed, 11 insertions(+), 1 deletions(-)
diff --git a/Lib/test/regrtest.py b/Lib/test/regrtest.py --- a/Lib/test/regrtest.py +++ b/Lib/test/regrtest.py @@ -172,6 +172,7 @@ import platform import random import re +import signal import sys import sysconfig import tempfile @@ -266,9 +267,18 @@ on the command line. """ - # Display the Python traceback fatal errors (e.g. segfault) + # Display the Python traceback on fatal errors (e.g. segfault) faulthandler.enable(allthreads=True) + # Display the Python traceback on SIGALRM or SIGUSR1 signal + signals = [] + if hasattr(signal, 'SIGALRM'): + signals.append(signal.SIGALRM) + if hasattr(signal, 'SIGUSR1'): + signals.append(signal.SIGUSR1) + for signum in signals: + faulthandler.register(signum, chain=True) + replacestdout() support.recordoriginalstdout(sys.stdout)
Python-checkins mailing list Python-checkins at python.org http://mail.python.org/mailman/listinfo/python-checkins
- Previous message: [Python-Dev] Failed to install PIL on windows, may have something to do with python implementaton
- Next message: [Python-Dev] cpython: Issue #12550: regrtest displays the Python traceback on SIGALRM or SIGUSR1
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]