Skip to content

Commit 3cba502

Browse files
Use PyErr_FormatUnraisable
1 parent e8035ec commit 3cba502

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Python/gc.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -914,7 +914,8 @@ handle_weakrefs(PyGC_Head *unreachable, PyGC_Head *old, bool allow_callbacks)
914914
/* copy-paste of weakrefobject.c's handle_callback() */
915915
temp = PyObject_CallOneArg(callback, (PyObject *)wr);
916916
if (temp == NULL) {
917-
PyErr_WriteUnraisable(callback);
917+
PyErr_FormatUnraisable("Exception ignored on "
918+
"calling weakref callback %R", callback);
918919
}
919920
else {
920921
Py_DECREF(temp);

0 commit comments

Comments
 (0)