[Python-checkins] cpython: Fix the user signal handler of faulthandler

victor.stinner python-checkins at python.org
Wed Aug 1 19:45:34 CEST 2012


http://hg.python.org/cpython/rev/2dd1aaf41319
changeset:   78372:2dd1aaf41319
user:        Victor Stinner <victor.stinner at gmail.com>
date:        Wed Aug 01 19:36:36 2012 +0200
summary:
  Fix the user signal handler of faulthandler

Don't exit the tstate is NULL to restore the errno and chain the signal handler
if needed.

files:
  Modules/faulthandler.c |  5 ++---
  1 files changed, 2 insertions(+), 3 deletions(-)


diff --git a/Modules/faulthandler.c b/Modules/faulthandler.c
--- a/Modules/faulthandler.c
+++ b/Modules/faulthandler.c
@@ -653,9 +653,8 @@
     if (user->all_threads)
         _Py_DumpTracebackThreads(user->fd, user->interp, tstate);
     else {
-        if (tstate == NULL)
-            return;
-        _Py_DumpTraceback(user->fd, tstate);
+        if (tstate != NULL)
+            _Py_DumpTraceback(user->fd, tstate);
     }
 #ifdef HAVE_SIGACTION
     if (user->chain) {

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list