[GRASS-SVN] r59228 - grass/trunk/scripts/m.proj

svn_grass at osgeo.org svn_grass at osgeo.org
Mon Mar 10 12:59:53 PDT 2014


Author: martinl
Date: 2014-03-10 12:59:52 -0700 (Mon, 10 Mar 2014)
New Revision: 59228

Modified:
   grass/trunk/scripts/m.proj/m.proj.py
Log:
m.proj: print reasonable error message when unable to parse output


Modified: grass/trunk/scripts/m.proj/m.proj.py
===================================================================
--- grass/trunk/scripts/m.proj/m.proj.py	2014-03-10 17:28:35 UTC (rev 59227)
+++ grass/trunk/scripts/m.proj/m.proj.py	2014-03-10 19:59:52 UTC (rev 59228)
@@ -263,8 +263,12 @@
 	if include_header:
 	    outf.write("x%sy%sz\n" % (ofs, ofs))
 	for line in p.stdout:
-	    xy, z = line.split(' ', 1)
-	    x, y = xy.split('\t')
+            try:
+                xy, z = line.split(' ', 1)
+                x, y = xy.split('\t')
+            except ValueError:
+                grass.fatal(line)
+            
 	    outf.write('%s%s%s%s%s\n' % \
                        (x.strip(), ofs, y.strip(), ofs, z.strip()))
     else:



More information about the grass-commit mailing list