mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +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
|
@ -34,7 +34,6 @@
|
|||
#include "pycore_flowgraph.h"
|
||||
#include "pycore_intrinsics.h"
|
||||
#include "pycore_long.h" // _PyLong_GetZero()
|
||||
#include "pycore_pyerrors.h" // _PyErr_WriteUnraisableMsg()
|
||||
#include "pycore_pystate.h" // _Py_GetConfig()
|
||||
#include "pycore_setobject.h" // _PySet_NextEntry()
|
||||
#include "pycore_symtable.h" // PySTEntryObject, _PyFuture_FromAST()
|
||||
|
@ -1407,8 +1406,8 @@ compiler_exit_scope(struct compiler *c)
|
|||
assert(c->u);
|
||||
/* we are deleting from a list so this really shouldn't fail */
|
||||
if (PySequence_DelItem(c->c_stack, n) < 0) {
|
||||
_PyErr_WriteUnraisableMsg("on removing the last compiler "
|
||||
"stack item", NULL);
|
||||
PyErr_FormatUnraisable("Exception ignored on removing "
|
||||
"the last compiler stack item");
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue