[GRASS-SVN] r60870 - grass/trunk/lib/python/script

svn_grass at osgeo.org svn_grass at osgeo.org
Thu Jun 19 07:35:05 PDT 2014


Author: glynn
Date: 2014-06-19 07:35:05 -0700 (Thu, 19 Jun 2014)
New Revision: 60870

Modified:
   grass/trunk/lib/python/script/core.py
Log:
Use subprocess.Popen() directly for calling g.parser


Modified: grass/trunk/lib/python/script/core.py
===================================================================
--- grass/trunk/lib/python/script/core.py	2014-06-18 19:59:38 UTC (rev 60869)
+++ grass/trunk/lib/python/script/core.py	2014-06-19 14:35:05 UTC (rev 60870)
@@ -644,7 +644,8 @@
         else:
             argv[0] = os.path.join(sys.path[0], name)
 
-    p = Popen(['g.parser', '-n'] + argv, stdout=PIPE)
+    prog = "g.parser.exe" if sys.platform == "win32" else "g.parser"
+    p = subprocess.Popen([prog, '-n'] + argv, stdout=subprocess.PIPE)
     s = p.communicate()[0]
     lines = s.split('\0')
 



More information about the grass-commit mailing list