Commits

Victor Stinner  committed 75def95

Fix _PyFaulthandler_Fini() so it can be called before _PyFaulthandler_Init()

  • Participants
  • Parent commits 6d395ed

Comments (0)

Files changed (1)

File Modules/faulthandler.c

 
 #ifdef FAULTHANDLER_LATER
     /* later */
-    cancel_dump_tracebacks_later();
     if (thread.cancel_event) {
+        cancel_dump_tracebacks_later();
         PyThread_release_lock(thread.cancel_event);
         PyThread_free_lock(thread.cancel_event);
         thread.cancel_event = NULL;
 
 #ifdef FAULTHANDLER_WATCHDOG
     /* file watchdog */
-    cancel_file_watchdog();
     if (watchdog.cancel_event) {
+        cancel_file_watchdog();
         PyThread_release_lock(watchdog.cancel_event);
         PyThread_free_lock(watchdog.cancel_event);
         watchdog.cancel_event = NULL;