diff options
Diffstat (limited to 'Modules/arraymodule.c')
-rw-r--r-- | Modules/arraymodule.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Modules/arraymodule.c b/Modules/arraymodule.c index b5f819e..16a7a7e 100644 --- a/Modules/arraymodule.c +++ b/Modules/arraymodule.c @@ -1820,6 +1820,8 @@ array_buffer_getbuf(arrayobject *self, Py_buffer *view, int flags) if (view==NULL) goto finish; view->buf = (void *)self->ob_item; + view->obj = (PyObject*)self; + Py_INCREF(self); if (view->buf == NULL) view->buf = (void *)emptybuf; view->len = (Py_SIZE(self)) * self->ob_descr->itemsize; |