Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Check and silence errors in tp_clear.
  • Loading branch information
serhiy-storchaka committed May 29, 2018
commit 8de8f206b38eade288eb0cb5ad4ad4a83b9d4fec
6 changes: 5 additions & 1 deletion Modules/gcmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -767,7 +767,11 @@ delete_garbage(PyGC_Head *collectable, PyGC_Head *old)
if ((clear = Py_TYPE(op)->tp_clear) != NULL) {
Py_INCREF(op);
(void) clear(op);
assert(!PyErr_Occurred());
if (PyErr_Occurred()) {
PySys_WriteStderr("Exception ignored in tp_clear of "
"%.50s\n", Py_TYPE(op)->tp_name);
PyErr_WriteUnraisable(NULL);
}
Py_DECREF(op);
}
}
Expand Down