diff --git a/Misc/NEWS.d/next/Library/2017-10-09-12-22-57.bpo-31701.Ti8o41.rst b/Misc/NEWS.d/next/Library/2017-10-09-12-22-57.bpo-31701.Ti8o41.rst new file mode 100644 index 00000000000000..a7b4da6acd9f66 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2017-10-09-12-22-57.bpo-31701.Ti8o41.rst @@ -0,0 +1,3 @@ +On Windows, faulthandler.enable() now registers the exception handler as the +last handler to be called, rather than the first to be called. It prevents +handled C++ exceptions to be logged by faulthandler. diff --git a/Modules/faulthandler.c b/Modules/faulthandler.c index c2c2c537b12cf3..41713d5df4c80d 100644 --- a/Modules/faulthandler.c +++ b/Modules/faulthandler.c @@ -457,7 +457,7 @@ faulthandler_enable(void) #ifdef MS_WINDOWS assert(fatal_error.exc_handler == NULL); - fatal_error.exc_handler = AddVectoredExceptionHandler(1, faulthandler_exc_handler); + fatal_error.exc_handler = AddVectoredExceptionHandler(0, faulthandler_exc_handler); #endif return 0; }