mirror of
https://github.com/python/cpython.git
synced 2025-08-30 21:48:47 +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
|
@ -2235,7 +2235,7 @@ PyEval_SetProfile(Py_tracefunc func, PyObject *arg)
|
|||
PyThreadState *tstate = _PyThreadState_GET();
|
||||
if (_PyEval_SetProfile(tstate, func, arg) < 0) {
|
||||
/* Log _PySys_Audit() error */
|
||||
_PyErr_WriteUnraisableMsg("in PyEval_SetProfile", NULL);
|
||||
PyErr_FormatUnraisable("Exception ignored in PyEval_SetProfile");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2252,7 +2252,7 @@ PyEval_SetProfileAllThreads(Py_tracefunc func, PyObject *arg)
|
|||
|
||||
while (ts) {
|
||||
if (_PyEval_SetProfile(ts, func, arg) < 0) {
|
||||
_PyErr_WriteUnraisableMsg("in PyEval_SetProfileAllThreads", NULL);
|
||||
PyErr_FormatUnraisable("Exception ignored in PyEval_SetProfileAllThreads");
|
||||
}
|
||||
HEAD_LOCK(runtime);
|
||||
ts = PyThreadState_Next(ts);
|
||||
|
@ -2266,7 +2266,7 @@ PyEval_SetTrace(Py_tracefunc func, PyObject *arg)
|
|||
PyThreadState *tstate = _PyThreadState_GET();
|
||||
if (_PyEval_SetTrace(tstate, func, arg) < 0) {
|
||||
/* Log _PySys_Audit() error */
|
||||
_PyErr_WriteUnraisableMsg("in PyEval_SetTrace", NULL);
|
||||
PyErr_FormatUnraisable("Exception ignored in PyEval_SetTrace");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2283,7 +2283,7 @@ PyEval_SetTraceAllThreads(Py_tracefunc func, PyObject *arg)
|
|||
|
||||
while (ts) {
|
||||
if (_PyEval_SetTrace(ts, func, arg) < 0) {
|
||||
_PyErr_WriteUnraisableMsg("in PyEval_SetTraceAllThreads", NULL);
|
||||
PyErr_FormatUnraisable("Exception ignored in PyEval_SetTraceAllThreads");
|
||||
}
|
||||
HEAD_LOCK(runtime);
|
||||
ts = PyThreadState_Next(ts);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue