Skip to content

Commit c845dd0

Browse files
committed
correctly use PyErr_FormatUnraisable
1 parent 6116032 commit c845dd0

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Modules/_curses_panel.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -434,11 +434,13 @@ PyCursesPanel_Dealloc(PyObject *self)
434434
if (obj) {
435435
Py_DECREF(obj);
436436
if (set_panel_userptr(po->pan, NULL) == ERR) {
437-
PyErr_FormatUnraisable("Exception ignored in set_panel_userptr()");
437+
curses_panel_panel_set_error(po, "set_panel_userptr", "__del__");
438+
PyErr_FormatUnraisable("Exception ignored in PyCursesPanel_Dealloc()");
438439
}
439440
}
440441
if (del_panel(po->pan) == ERR) {
441-
PyErr_FormatUnraisable("Exception ignored in del_panel()");
442+
curses_panel_panel_set_error(po, "del_panel", "__del__");
443+
PyErr_FormatUnraisable("Exception ignored in PyCursesPanel_Dealloc()");
442444
}
443445
if (po->wo != NULL) {
444446
Py_DECREF(po->wo);

0 commit comments

Comments
 (0)