浏览代码

pythonlib: parser() check p.returncode

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@46862 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa 14 年之前
父节点
当前提交
334f681d2e
共有 1 个文件被更改,包括 5 次插入2 次删除
  1. 5 2
      lib/python/core.py

+ 5 - 2
lib/python/core.py

@@ -447,8 +447,11 @@ def parser():
     lines = s.splitlines()
     
     if not lines or lines[0].rstrip('\r\n') != "@ARGS_PARSED@":
-	sys.stdout.write(s)
-	sys.exit(1)
+        if p.returncode == 0:
+            sys.exit(0)
+        else:
+            sys.stdout.write(s)
+            sys.exit(1)
 
     return _parse_opts(lines[1:])