summaryrefslogtreecommitdiffstats
path: root/Python/compile.c
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2023-11-02 09:16:34 (GMT)
committerGitHub <noreply@github.com>2023-11-02 09:16:34 (GMT)
commit970e719a7a829bddc647bbaa668dd8603abdddef (patch)
tree92eeeba01687f6e02482315db653ce57f3b10e4b /Python/compile.c
parenta12f624a9dc1c44bb20a20b13fd164c14b987892 (diff)
downloadcpython-970e719a7a829bddc647bbaa668dd8603abdddef.zip
cpython-970e719a7a829bddc647bbaa668dd8603abdddef.tar.gz
cpython-970e719a7a829bddc647bbaa668dd8603abdddef.tar.bz2
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>
Diffstat (limited to 'Python/compile.c')
-rw-r--r--Python/compile.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/Python/compile.c b/Python/compile.c
index 3ff6418..30005c3 100644
--- a/Python/compile.c
+++ b/Python/compile.c
@@ -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 {