mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-08-10 03:40:29 +00:00
show exception before fatality exit
This commit is contained in:
parent
957fd4a976
commit
10b210a83a
1 changed files with 3 additions and 8 deletions
5
third_party/python/Python/fatality.c
vendored
5
third_party/python/Python/fatality.c
vendored
|
@ -124,16 +124,11 @@ Py_FatalError(const char *msg)
|
||||||
}
|
}
|
||||||
int has_tstate_and_gil = (tss_tstate != NULL);
|
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 an exception is set, print the exception with its traceback */
|
||||||
if (!_Py_FatalError_PrintExc(fd)) {
|
if (!_Py_FatalError_PrintExc(fd)) {
|
||||||
/* No exception is set, or an exception is set without traceback */
|
/* No exception is set, or an exception is set without traceback */
|
||||||
_Py_FatalError_DumpTracebacks(fd);
|
_Py_FatalError_DumpTracebacks(fd);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else {
|
|
||||||
_Py_FatalError_DumpTracebacks(fd);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* The main purpose of faulthandler is to display the traceback. We already
|
/* The main purpose of faulthandler is to display the traceback. We already
|
||||||
* did our best to display it. So faulthandler can now be disabled.
|
* did our best to display it. So faulthandler can now be disabled.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue