File: numpy_deprecated_api.patch

package info (click to toggle)
pylibtiff 0.3.0~svn78-3.1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 560 kB
  • ctags: 2,766
  • sloc: python: 5,227; ansic: 1,011; sh: 16; makefile: 8
file content (45 lines) | stat: -rw-r--r-- 1,473 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
Description: updated bittools.c and tif_lzw.c to build with numpy v1.7.x c-api
 .
 support for PyArray_CORDER appears to have been removed in 1.7 and is replaced
 by NPY_CORDER. NPY_CORDER has been supported since v1.0
Origin: upstream, https://code.google.com/p/pylibtiff/source/detail?spec=svn93&r=92
Bug: http://code.google.com/p/pylibtiff/issues/detail?id=23
Bug-Debian: http://bugs.debian.org/713588
Forwarded: http://code.google.com/p/pylibtiff/issues/detail?id=23
Author: richcarni@gmail.com
Reviewed-by: gregor herrmann <gregoa@debian.org>
Last-Update: 2013-07-07
Applied-Upstream: svn, r92

--- a/libtiff/src/tif_lzw.c
+++ b/libtiff/src/tif_lzw.c
@@ -45,7 +45,10 @@
 
 
 #include <Python.h>
-#define NPY_NO_DEPRECATED_API
+#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION
+#if NPY_VERSION < 0x01000009
+  #define NPY_CORDER PyArray_CORDER
+#endif
 #define PY_ARRAY_UNIQUE_SYMBOL PyArray_API
 #include "numpy/arrayobject.h"
 
@@ -1215,7 +1218,7 @@
 	  dims[0] -= occ;
 	  newshape.ptr = dims;
 	  newshape.len = 1;
-	  if (PyArray_Resize((PyArrayObject*)result, &newshape, 0, PyArray_CORDER)==NULL)
+	  if (PyArray_Resize((PyArrayObject*)result, &newshape, 0, NPY_CORDER)==NULL)
 	    return NULL;
 	}
     }
--- a/libtiff/src/bittools.c
+++ b/libtiff/src/bittools.c
@@ -1,5 +1,5 @@
 #include <Python.h>
-#define NPY_NO_DEPRECATED_API
+#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION
 #define PY_ARRAY_UNIQUE_SYMBOL PyArray_API
 #include "numpy/arrayobject.h"