mirror of
https://github.com/python/cpython.git
synced 2025-07-08 03:45:36 +00:00
gh-108082: Use PyErr_FormatUnraisable() (GH-111580)
Replace most of calls of _PyErr_WriteUnraisableMsg() and some calls of PyErr_WriteUnraisable(NULL) with PyErr_FormatUnraisable(). Co-authored-by: Victor Stinner <vstinner@python.org>
This commit is contained in:
parent
a12f624a9d
commit
970e719a7a
18 changed files with 83 additions and 114 deletions
|
@ -650,7 +650,7 @@ _PyErr_PrintEx(PyThreadState *tstate, int set_sys_last_vars)
|
|||
PyErr_Clear();
|
||||
goto done;
|
||||
}
|
||||
_PyErr_WriteUnraisableMsg("in audit hook", NULL);
|
||||
PyErr_FormatUnraisable("Exception ignored in audit hook");
|
||||
}
|
||||
if (hook) {
|
||||
PyObject* args[3] = {typ, exc, tb};
|
||||
|
@ -1093,7 +1093,8 @@ fallback:
|
|||
_PyRuntime.signals.unhandled_keyboard_interrupt = unhandled_keyboard_interrupt;
|
||||
#ifdef Py_DEBUG
|
||||
if (PyErr_Occurred()) {
|
||||
_PyErr_WriteUnraisableMsg("in the internal traceback machinery", NULL);
|
||||
PyErr_FormatUnraisable(
|
||||
"Exception ignored in the internal traceback machinery");
|
||||
}
|
||||
#endif
|
||||
PyErr_Clear();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue