diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2016-03-16 22:19:15 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2016-03-16 22:19:15 (GMT) |
commit | 2025d7839b1d0c5c3cc83601568f16177b1d85b0 (patch) | |
tree | 5a55c42f42164c0fa2cd7651971e33972bc0bbd7 /Python | |
parent | 861d9abfcf6a4a34790e4edc5e440a68534137e1 (diff) | |
download | cpython-2025d7839b1d0c5c3cc83601568f16177b1d85b0.zip cpython-2025d7839b1d0c5c3cc83601568f16177b1d85b0.tar.gz cpython-2025d7839b1d0c5c3cc83601568f16177b1d85b0.tar.bz2 |
Py_FatalError: disable faulthandler earlier
Issue #26563: Py_FatalError: disable faulthandler before trying to flush
sys.stdout and sys.stderr.
Diffstat (limited to 'Python')
-rw-r--r-- | Python/pylifecycle.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Python/pylifecycle.c b/Python/pylifecycle.c index 41528cd..502a1e6 100644 --- a/Python/pylifecycle.c +++ b/Python/pylifecycle.c @@ -1371,17 +1371,17 @@ Py_FatalError(const char *msg) if (!_Py_FatalError_PrintExc(fd)) _Py_FatalError_DumpTracebacks(fd); + /* The main purpose of faulthandler is to display the traceback. We already + * did our best to display it. So faulthandler can now be disabled. + * (Don't trigger it on abort().) */ + _PyFaulthandler_Fini(); + /* Check if the current Python thread hold the GIL */ if (PyThreadState_GET() != NULL) { /* Flush sys.stdout and sys.stderr */ flush_std_files(); } - /* The main purpose of faulthandler is to display the traceback. We already - * did our best to display it. So faulthandler can now be disabled. - * (Don't trigger it on abort().) */ - _PyFaulthandler_Fini(); - #ifdef MS_WINDOWS len = strlen(msg); |