[GRASS-SVN] r44673 - grass/branches/releasebranch_6_4/lib/python

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Dec 22 09:09:00 EST 2010


Author: martinl
Date: 2010-12-22 06:09:00 -0800 (Wed, 22 Dec 2010)
New Revision: 44673

Modified:
   grass/branches/releasebranch_6_4/lib/python/core.py
Log:
pythonlib: parser(): returncode 1 on failure
(merge r44671 from trunk)


Modified: grass/branches/releasebranch_6_4/lib/python/core.py
===================================================================
--- grass/branches/releasebranch_6_4/lib/python/core.py	2010-12-22 14:08:20 UTC (rev 44672)
+++ grass/branches/releasebranch_6_4/lib/python/core.py	2010-12-22 14:09:00 UTC (rev 44673)
@@ -418,11 +418,11 @@
     if not os.getenv("GISBASE"):
         print >> sys.stderr, "You must be in GRASS GIS to run this program."
         sys.exit(1)
-
+    
     cmdline = [basename(sys.argv[0])]
     cmdline += ['"' + arg + '"' for arg in sys.argv[1:]]
     os.environ['CMDLINE'] = ' '.join(cmdline)
-
+    
     argv = sys.argv[:]
     name = argv[0]
     if not os.path.isabs(name):
@@ -430,14 +430,14 @@
 	    argv[0] = os.path.abspath(name)
 	else:
 	    argv[0] = os.path.join(sys.path[0], name)
-
+    
     p = Popen(['g.parser', '-s'] + argv, stdout = PIPE)
     s = p.communicate()[0]
     lines = s.splitlines()
-
+    
     if not lines or lines[0].rstrip('\r\n') != "@ARGS_PARSED@":
 	sys.stdout.write(s)
-	sys.exit()
+	sys.exit(1)
 
     return _parse_opts(lines[1:])
 



More information about the grass-commit mailing list