Bläddra i källkod

m.proj: print reasonable error message when unable to parse output

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@59228 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa 11 år sedan
förälder
incheckning
649fb42016
1 ändrade filer med 6 tillägg och 2 borttagningar
  1. 6 2
      scripts/m.proj/m.proj.py

+ 6 - 2
scripts/m.proj/m.proj.py

@@ -263,8 +263,12 @@ def main():
 	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: