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

Skip to content

Commit 5ed5f2e

Browse files
authored
Merge pull request matplotlib#7517 from QuLogic/ext-deprecations
Remove deprecations from C extensions
2 parents fc204fa + 5c1a90e commit 5ed5f2e

File tree

2 files changed

+1
-21
lines changed

2 files changed

+1
-21
lines changed

src/_backend_gdk.c

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,6 @@
77

88
#include <pygtk/pygtk.h>
99

10-
// support numpy 1.6 - this macro was renamed and deprecated at once in 1.7
11-
#ifndef NPY_ARRAY_WRITEABLE
12-
#define NPY_ARRAY_WRITEABLE NPY_WRITEABLE
13-
#endif
14-
1510
static PyTypeObject *_PyGdkPixbuf_Type;
1611
#define PyGdkPixbuf_Type (*_PyGdkPixbuf_Type)
1712

@@ -52,15 +47,11 @@ static PyObject *pixbuf_get_pixels_array(PyObject *self, PyObject *args)
5247

5348
/* the array holds a ref to the pixbuf pixels through this wrapper*/
5449
Py_INCREF(py_pixbuf);
55-
#if NPY_API_VERSION >= 0x00000007
5650
if (PyArray_SetBaseObject(array, (PyObject *)py_pixbuf) == -1) {
5751
Py_DECREF(py_pixbuf);
5852
Py_DECREF(array);
5953
return NULL;
6054
}
61-
#else
62-
PyArray_BASE(array) = (PyObject *) py_pixbuf;
63-
#endif
6455
return PyArray_Return(array);
6556
}
6657

src/_macosx.m

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,6 @@
1111
#define PY3K 0
1212
#endif
1313

14-
#if (PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION >=3)
15-
#define PY33 1
16-
#else
17-
#define PY33 0
18-
#endif
19-
20-
/* Must define Py_TYPE for Python 2.5 or older */
21-
#ifndef Py_TYPE
22-
# define Py_TYPE(o) ((o)->ob_type)
23-
#endif
24-
2514
/* Proper way to check for the OS X version we are compiling for, from
2615
http://developer.apple.com/documentation/DeveloperTools/Conceptual/cross_development */
2716
#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1050
@@ -1896,7 +1885,7 @@ -(void)save_figure:(id)sender
18961885
unsigned int n = [filename length];
18971886
unichar* buffer = malloc(n*sizeof(unichar));
18981887
[filename getCharacters: buffer];
1899-
#if PY33
1888+
#if PY3K
19001889
PyObject* string = PyUnicode_FromKindAndData(PyUnicode_2BYTE_KIND, buffer, n);
19011890
#else
19021891
PyObject* string = PyUnicode_FromUnicode(buffer, n);

0 commit comments

Comments
 (0)