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

Skip to content

Commit fc648d8

Browse files
committed
Remove deprecated Numpy call.
svn path=/trunk/matplotlib/; revision=6036
1 parent 7c5b981 commit fc648d8

1 file changed

Lines changed: 1 addition & 10 deletions

File tree

src/_backend_gdk.c

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,6 @@
1212
static PyTypeObject *_PyGdkPixbuf_Type;
1313
#define PyGdkPixbuf_Type (*_PyGdkPixbuf_Type)
1414

15-
/* Implement the equivalent to gtk.gdk.Pixbuf.get_pixels_array()
16-
* To solve these problems with the pygtk version:
17-
* 1) It works for Numeric, but not numarray
18-
* 2) Its only available if pygtk is compiled with Numeric support
19-
* Fedora 1,2,3 has PyGTK, but not Numeric and so does not have
20-
* Pixbuf.get_pixels_array().
21-
* Fedora 4 does have PyGTK, Numeric and Pixbuf.get_pixels_array()
22-
*/
23-
2415
static PyObject *
2516
pixbuf_get_pixels_array(PyObject *self, PyObject *args)
2617
{
@@ -45,7 +36,7 @@ pixbuf_get_pixels_array(PyObject *self, PyObject *args)
4536
if (gdk_pixbuf_get_has_alpha(gdk_pixbuf))
4637
dims[2] = 4;
4738

48-
array = (PyArrayObject *)PyArray_FromDimsAndData(3, dims, PyArray_UBYTE,
39+
array = (PyArrayObject *)PyArray_SimpleNewFromData(3, dims, PyArray_UBYTE,
4940
(char *)gdk_pixbuf_get_pixels(gdk_pixbuf));
5041
if (array == NULL)
5142
return NULL;

0 commit comments

Comments
 (0)