]> granicus.if.org Git - python/commitdiff
Fix the user signal handler of faulthandler
authorVictor Stinner <victor.stinner@gmail.com>
Wed, 1 Aug 2012 17:36:36 +0000 (19:36 +0200)
committerVictor Stinner <victor.stinner@gmail.com>
Wed, 1 Aug 2012 17:36:36 +0000 (19:36 +0200)
Don't exit the tstate is NULL to restore the errno and chain the signal handler
if needed.

Modules/faulthandler.c

index 6e8fbf78fde67325e46e4ff524b81c93adb6df96..469e49026836422012d89b68bc8f055c3a5889c8 100644 (file)
@@ -653,9 +653,8 @@ faulthandler_user(int signum)
     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) {