mirror of
https://github.com/python/cpython.git
synced 2026-01-06 15:32:22 +00:00
bpo-28994: Fixed errors handling in atexit._run_exitfuncs(). (#2034)
The traceback no longer displayed for SystemExit raised in a callback registered by atexit.
This commit is contained in:
parent
1dbce04d0e
commit
3fd54d4a7e
3 changed files with 14 additions and 1 deletions
|
|
@ -97,7 +97,7 @@ atexit_callfuncs(void)
|
|||
Py_XDECREF(exc_tb);
|
||||
}
|
||||
PyErr_Fetch(&exc_type, &exc_value, &exc_tb);
|
||||
if (!PyErr_ExceptionMatches(PyExc_SystemExit)) {
|
||||
if (!PyErr_GivenExceptionMatches(exc_type, PyExc_SystemExit)) {
|
||||
PySys_WriteStderr("Error in atexit._run_exitfuncs:\n");
|
||||
PyErr_NormalizeException(&exc_type, &exc_value, &exc_tb);
|
||||
PyErr_Display(exc_type, exc_value, exc_tb);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue