[Numpy-svn] r4827 - trunk/numpy/lib

numpy-svn@scip... numpy-svn@scip...
Wed Feb 27 16:56:11 CST 2008


Author: rkern
Date: 2008-02-27 16:56:07 -0600 (Wed, 27 Feb 2008)
New Revision: 4827

Modified:
   trunk/numpy/lib/io.py
Log:
Handle the no-comment case correctly.

Modified: trunk/numpy/lib/io.py
===================================================================
--- trunk/numpy/lib/io.py	2008-02-27 20:59:20 UTC (rev 4826)
+++ trunk/numpy/lib/io.py	2008-02-27 22:56:07 UTC (rev 4827)
@@ -293,7 +293,11 @@
 
     for i,line in enumerate(fh):
         if i<skiprows: continue
-        line = line[:line.find(comments)].strip()
+        comment_start = line.find(comments)
+        if comment_start > 0:
+            line = line[:comments_start].strip()
+        else:
+            line = line.strip()
         if not len(line): continue
         vals = line.split(delimiter)
         if converterseq is None:



More information about the Numpy-svn mailing list