Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b77b28a

Browse files
mdboomjkseppan
authored andcommitted
Fix _backend_gdk.c
1 parent 2cacc37 commit b77b28a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/_backend_gdk.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,14 @@ static PyObject *pixbuf_get_pixels_array(PyObject *self, PyObject *args)
4040
array = (PyArrayObject*)
4141
PyArray_New(&PyArray_Type, 3, dims, NPY_UBYTE, strides,
4242
(void*)gdk_pixbuf_get_pixels(gdk_pixbuf), 1,
43-
0, NULL);
43+
NPY_ARRAY_WRITEABLE, NULL);
4444

4545
if (array == NULL)
4646
return NULL;
4747

4848
/* the array holds a ref to the pixbuf pixels through this wrapper*/
4949
Py_INCREF(py_pixbuf);
50-
array->base = (PyObject *)py_pixbuf;
50+
PyArray_SetBaseObject(array, (PyObject *)py_pixbuf);
5151
return PyArray_Return(array);
5252
}
5353

0 commit comments

Comments
 (0)