Skip to content

Commit

Permalink
Use PyErr_FormatUnraisable() on Python 3.13 (#34)
Browse files Browse the repository at this point in the history
Use the new public PyErr_FormatUnraisable() on Python 3.13.

The private _PyErr_WriteUnraisableMsg() function was removed in
Python 3.13:
python/cpython#111643
  • Loading branch information
vstinner authored Nov 16, 2023
1 parent a490b4b commit 49127c6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/c/_cffi_backend.c
Original file line number Diff line number Diff line change
Expand Up @@ -6118,7 +6118,11 @@ static void _my_PyErr_WriteUnraisable(PyObject *t, PyObject *v, PyObject *tb,

PyErr_Restore(t, v, tb);
if (s != NULL) {
#if PY_VERSION_HEX >= 0x030D0000
PyErr_FormatUnraisable("Exception ignored %S", s);
#else
_PyErr_WriteUnraisableMsg(PyText_AS_UTF8(s), NULL);
#endif
Py_DECREF(s);
}
else
Expand Down

0 comments on commit 49127c6

Please sign in to comment.