Skip to content

Commit 6116032

Browse files
committed
report unraisable errors in the destructor
1 parent c4806b2 commit 6116032

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

Modules/_curses_panel.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -432,10 +432,14 @@ PyCursesPanel_Dealloc(PyObject *self)
432432
tp = (PyObject *) Py_TYPE(po);
433433
obj = (PyObject *) panel_userptr(po->pan);
434434
if (obj) {
435-
(void)set_panel_userptr(po->pan, NULL);
436435
Py_DECREF(obj);
436+
if (set_panel_userptr(po->pan, NULL) == ERR) {
437+
PyErr_FormatUnraisable("Exception ignored in set_panel_userptr()");
438+
}
439+
}
440+
if (del_panel(po->pan) == ERR) {
441+
PyErr_FormatUnraisable("Exception ignored in del_panel()");
437442
}
438-
(void)del_panel(po->pan);
439443
if (po->wo != NULL) {
440444
Py_DECREF(po->wo);
441445
remove_lop(po);

0 commit comments

Comments
 (0)