From 10b210a83a246515ed9242ad1c01b840f9ffeada Mon Sep 17 00:00:00 2001 From: ahgamut <41098605+ahgamut@users.noreply.github.com> Date: Sat, 28 May 2022 15:23:18 +0530 Subject: [PATCH] show exception before fatality exit --- third_party/python/Python/fatality.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/third_party/python/Python/fatality.c b/third_party/python/Python/fatality.c index 8b65bc79f..51100e271 100644 --- a/third_party/python/Python/fatality.c +++ b/third_party/python/Python/fatality.c @@ -124,14 +124,9 @@ Py_FatalError(const char *msg) } int has_tstate_and_gil = (tss_tstate != NULL); - if (has_tstate_and_gil) { - /* If an exception is set, print the exception with its traceback */ - if (!_Py_FatalError_PrintExc(fd)) { - /* No exception is set, or an exception is set without traceback */ - _Py_FatalError_DumpTracebacks(fd); - } - } - else { + /* If an exception is set, print the exception with its traceback */ + if (!_Py_FatalError_PrintExc(fd)) { + /* No exception is set, or an exception is set without traceback */ _Py_FatalError_DumpTracebacks(fd); }