[Numpy-svn] r5401 - trunk/numpy/core/src

numpy-svn@scip... numpy-svn@scip...
Sun Jul 13 14:22:30 CDT 2008


Author: charris
Date: 2008-07-13 14:22:26 -0500 (Sun, 13 Jul 2008)
New Revision: 5401

Modified:
   trunk/numpy/core/src/arrayobject.c
Log:
Fix Deprecation warnings for python versions < 2.5.x


Modified: trunk/numpy/core/src/arrayobject.c
===================================================================
--- trunk/numpy/core/src/arrayobject.c	2008-07-13 18:19:16 UTC (rev 5400)
+++ trunk/numpy/core/src/arrayobject.c	2008-07-13 19:22:26 UTC (rev 5401)
@@ -22,6 +22,12 @@
 */
 /*#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 @@
     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 @@
     char msg[] = "PyArray_FromDims";
     int err;
 
-    err = PyErr_WarnEx(PyExc_DeprecationWarning, msg, 1);
+    err = DEPRECATE(msg);
     if (err < 0) {
         return NULL;
     }



More information about the Numpy-svn mailing list