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

numpy-svn@scip... numpy-svn@scip...
Wed Apr 30 11:01:27 CDT 2008


Author: oliphant
Date: 2008-04-30 11:01:25 -0500 (Wed, 30 Apr 2008)
New Revision: 5113

Modified:
   trunk/numpy/core/src/multiarraymodule.c
Log:
Check for error and fix spacing.

Modified: trunk/numpy/core/src/multiarraymodule.c
===================================================================
--- trunk/numpy/core/src/multiarraymodule.c	2008-04-29 15:39:23 UTC (rev 5112)
+++ trunk/numpy/core/src/multiarraymodule.c	2008-04-30 16:01:25 UTC (rev 5113)
@@ -3458,6 +3458,7 @@
 
     /* make sure it is well-behaved */
     arr = PyArray_FromAny(op, NULL, 0, 0, CARRAY, NULL);
+    if (arr == NULL) return NULL;
     nd = PyArray_NDIM(arr);
     if (nd == 1) {     /* we will give in to old behavior */
         ret = PyArray_Copy((PyArrayObject *)arr);
@@ -3488,7 +3489,7 @@
     }
     /* do 2-d loop */
     NPY_BEGIN_ALLOW_THREADS;
-        optr = PyArray_DATA(ret);
+    optr = PyArray_DATA(ret);
     str2 = elsize*dims[0];
     for (i=0; i<dims[0]; i++) {
         iptr = PyArray_BYTES(arr) + i*elsize;
@@ -3500,7 +3501,7 @@
         }
     }
     NPY_END_ALLOW_THREADS;
-        Py_DECREF(arr);
+    Py_DECREF(arr);
     return ret;
 }
 



More information about the Numpy-svn mailing list