Skip to content

Commit 23a9664

Browse files
committed
explicitly raise PyErr_FormatUnraisable in tp_clear
1 parent c05db69 commit 23a9664

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

Modules/_curses_panel.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -438,8 +438,7 @@ PyCursesPanel_Clear(PyObject *op)
438438
Py_CLEAR(extra);
439439
if (set_panel_userptr(self->pan, NULL) == ERR) {
440440
curses_panel_panel_set_error(self, "set_panel_userptr", NULL);
441-
// Do not add a PyErr_FormatUnraisable() because the GC
442-
// is responsible for handling exceptions in tp_clear.
441+
PyErr_FormatUnraisable("Exception ignored in tp_clear of %s", op);
443442
}
444443
}
445444
// do NOT clear self->wo yet as there is no cycle to break with it

0 commit comments

Comments
 (0)