[Numpy-svn] r3454 - trunk/numpy/core

numpy-svn at scipy.org numpy-svn at scipy.org
Mon Nov 20 02:25:12 EST 2006


Author: stefan
Date: 2006-11-20 01:24:53 -0600 (Mon, 20 Nov 2006)
New Revision: 3454

Modified:
   trunk/numpy/core/defchararray.py
Log:
Fix startswith operation on character arrays.


Modified: trunk/numpy/core/defchararray.py
===================================================================
--- trunk/numpy/core/defchararray.py	2006-11-20 07:06:48 UTC (rev 3453)
+++ trunk/numpy/core/defchararray.py	2006-11-20 07:24:53 UTC (rev 3454)
@@ -151,7 +151,7 @@
         for k, val in enumerate(myiter):
             newval = []
             for chk in val[1:]:
-                if chk.dtype is object_ and chk.item() is None:
+                if not chk or (chk.dtype is object_ and chk.item() is None):
                     break
                 newval.append(chk)
             this_str = val[0].rstrip('\x00')




More information about the Numpy-svn mailing list