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

numpy-svn at scipy.org numpy-svn at scipy.org
Tue Sep 5 11:59:02 CDT 2006


Author: oliphant
Date: 2006-09-05 11:58:59 -0500 (Tue, 05 Sep 2006)
New Revision: 3121

Modified:
   trunk/numpy/core/src/arrayobject.c
Log:
Fix dimension error for object arrays.

Modified: trunk/numpy/core/src/arrayobject.c
===================================================================
--- trunk/numpy/core/src/arrayobject.c	2006-09-05 08:32:14 UTC (rev 3120)
+++ trunk/numpy/core/src/arrayobject.c	2006-09-05 16:58:59 UTC (rev 3121)
@@ -7157,15 +7157,20 @@
         int type = typecode->type_num;
         int itemsize = typecode->elsize;
 
-        stop_at_string = ((type == PyArray_OBJECT) ||   \
-                          (type == PyArray_STRING && \
-                           typecode->type == PyArray_STRINGLTR) ||      \
-                          (type == PyArray_UNICODE) ||  \
+        check_it = ((type != PyArray_STRING) &&
+                    (type != PyArray_UNICODE) &&
+                    (type != PyArray_VOID) &&
+                    (type != PyArray_CHAR));
+                    
+        stop_at_string = ((type == PyArray_OBJECT) ||   
+                          (type == PyArray_STRING && 
+                           typecode->type == PyArray_STRINGLTR) ||     
+                          (type == PyArray_UNICODE) ||  
                           (type == PyArray_VOID));
-
+        
         stop_at_tuple = (type == PyArray_VOID && (typecode->names       \
                                                   || typecode->subarray));
-
+        
         if (!((nd=discover_depth(s, MAX_DIMS+1, stop_at_string,
                                  stop_at_tuple)) > 0)) {
                 if (nd==0)
@@ -7186,7 +7191,6 @@
                 goto fail;
         }
 
-        check_it = !(stop_at_string || type == PyArray_STRING);
         if(discover_dimensions(s,nd,d, check_it) == -1) goto fail;
 
         if (typecode->type == PyArray_CHARLTR && nd > 0 && d[nd-1]==1) {



More information about the Numpy-svn mailing list