summaryrefslogtreecommitdiff
path: root/numpy/core/src
diff options
context:
space:
mode:
authorCharles Harris <charlesr.harris@gmail.com>2008-07-13 19:22:26 +0000
committerCharles Harris <charlesr.harris@gmail.com>2008-07-13 19:22:26 +0000
commit207e37a2eb9f2004c390c7b41cbdea4cc79afe59 (patch)
tree30cf74d0b244dc945255024188f4fa05eadee684 /numpy/core/src
parent303069205c70a1b9d9fddbeec25d839244588d32 (diff)
downloadnumpy-207e37a2eb9f2004c390c7b41cbdea4cc79afe59.tar.gz
Fix Deprecation warnings for python versions < 2.5.x
Diffstat (limited to 'numpy/core/src')
-rw-r--r--numpy/core/src/arrayobject.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/numpy/core/src/arrayobject.c b/numpy/core/src/arrayobject.c
index 72e0bebbe..d496233e9 100644
--- a/numpy/core/src/arrayobject.c
+++ b/numpy/core/src/arrayobject.c
@@ -22,6 +22,12 @@ maintainer email: oliphant.travis@ieee.org
*/
/*#include <stdio.h>*/
+#if PY_VERSION_HEX >= 0x02050000
+#define DEPRECATE(msg) PyErr_WarnEx(PyExc_DeprecationWarning,msg,1)
+#else
+#define DEPRECATE(msg) PyErr_Warn(PyExc_DeprecationWarning,msg)
+#endif
+
/*NUMPY_API
* Get Priority from object
*/
@@ -1316,7 +1322,7 @@ PyArray_FromDimsAndDataAndDescr(int nd, int *d,
char msg[] = "PyArray_FromDimsAndDataAndDescr";
int err;
- err = PyErr_WarnEx(PyExc_DeprecationWarning, msg, 1);
+ err = DEPRECATE(msg);
if (err < 0) {
return NULL;
}
@@ -1342,7 +1348,7 @@ PyArray_FromDims(int nd, int *d, int type)
char msg[] = "PyArray_FromDims";
int err;
- err = PyErr_WarnEx(PyExc_DeprecationWarning, msg, 1);
+ err = DEPRECATE(msg);
if (err < 0) {
return NULL;
}