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

numpy-svn@scip... numpy-svn@scip...
Mon Jul 14 00:37:43 CDT 2008


Author: charris
Date: 2008-07-14 00:37:40 -0500 (Mon, 14 Jul 2008)
New Revision: 5410

Modified:
   trunk/numpy/core/src/arrayobject.c
   trunk/numpy/core/src/multiarraymodule.c
Log:
Make deprecation messages more informative.


Modified: trunk/numpy/core/src/arrayobject.c
===================================================================
--- trunk/numpy/core/src/arrayobject.c	2008-07-14 00:29:17 UTC (rev 5409)
+++ trunk/numpy/core/src/arrayobject.c	2008-07-14 05:37:40 UTC (rev 5410)
@@ -1313,11 +1313,9 @@
     PyObject *ret;
     int i;
     intp newd[MAX_DIMS];
-    char msg[] = "PyArray_FromDimsAndDataAndDescr";
-    int err;
+    char msg[] = "PyArray_FromDimsAndDataAndDescr: use PyArray_NewFromDescr.";
 
-    err = DEPRECATE(msg);
-    if (err < 0) {
+    if (DEPRECATE(msg) < 0) {
         return NULL;
     }
     if (!PyArray_ISNBO(descr->byteorder))
@@ -1339,11 +1337,9 @@
 PyArray_FromDims(int nd, int *d, int type)
 {
     PyObject *ret;
-    char msg[] = "PyArray_FromDims";
-    int err;
+    char msg[] = "PyArray_FromDims: use PyArray_SimpleNew.";
 
-    err = DEPRECATE(msg);
-    if (err < 0) {
+    if (DEPRECATE(msg) < 0) {
         return NULL;
     }
     ret = PyArray_FromDimsAndDataAndDescr(nd, d,

Modified: trunk/numpy/core/src/multiarraymodule.c
===================================================================
--- trunk/numpy/core/src/multiarraymodule.c	2008-07-14 00:29:17 UTC (rev 5409)
+++ trunk/numpy/core/src/multiarraymodule.c	2008-07-14 05:37:40 UTC (rev 5410)
@@ -1665,11 +1665,9 @@
 {
     intp newd1;
     PyArray_Descr *descr;
-    int err;
-    char msg[] = "PyArray_As1D: use PyArray_AsCArray instead.";
+    char msg[] = "PyArray_As1D: use PyArray_AsCArray.";
 
-    err = DEPRECATE(msg);
-    if (err < 0) {
+    if (DEPRECATE(msg) < 0) {
         return -1;
     }
     descr = PyArray_DescrFromType(typecode);



More information about the Numpy-svn mailing list