Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 1134b0d

Browse files
author
Victor Stinner
committed
Fix _PyFaulthandler_Fini() so it can be called before _PyFaulthandler_Init()
1 parent 76961fa commit 1134b0d

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

Modules/faulthandler.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1282,8 +1282,8 @@ void _PyFaulthandler_Fini(void)
12821282

12831283
#ifdef FAULTHANDLER_LATER
12841284
/* later */
1285-
cancel_dump_tracebacks_later();
12861285
if (thread.cancel_event) {
1286+
cancel_dump_tracebacks_later();
12871287
PyThread_release_lock(thread.cancel_event);
12881288
PyThread_free_lock(thread.cancel_event);
12891289
thread.cancel_event = NULL;
@@ -1296,8 +1296,8 @@ void _PyFaulthandler_Fini(void)
12961296

12971297
#ifdef FAULTHANDLER_WATCHDOG
12981298
/* file watchdog */
1299-
cancel_file_watchdog();
13001299
if (watchdog.cancel_event) {
1300+
cancel_file_watchdog();
13011301
PyThread_release_lock(watchdog.cancel_event);
13021302
PyThread_free_lock(watchdog.cancel_event);
13031303
watchdog.cancel_event = NULL;

0 commit comments

Comments
 (0)