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

Markus Neteler neteler at osgeo.org
Fri Jun 20 07:07:04 PDT 2014


Hi Glynn,

is this a backport to relbr7 candidate?

On Thu, Jun 19, 2014 at 4:35 PM,  <svn_grass at osgeo.org> wrote:
> 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')


thanks
Markus


More information about the grass-dev mailing list