summaryrefslogtreecommitdiffstats
path: root/Objects/typeobject.c
diff options
context:
space:
mode:
Diffstat (limited to 'Objects/typeobject.c')
-rw-r--r--Objects/typeobject.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/Objects/typeobject.c b/Objects/typeobject.c
index a1ad502..c152532 100644
--- a/Objects/typeobject.c
+++ b/Objects/typeobject.c
@@ -9158,7 +9158,13 @@ releasebuffer_call_python(PyObject *self, Py_buffer *buffer)
Py_DECREF(ret);
}
if (!is_buffer_wrapper) {
- PyObject_CallMethodNoArgs(mv, &_Py_ID(release));
+ PyObject *res = PyObject_CallMethodNoArgs(mv, &_Py_ID(release));
+ if (res == NULL) {
+ PyErr_WriteUnraisable(self);
+ }
+ else {
+ Py_DECREF(res);
+ }
}
Py_DECREF(mv);
end: