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

Vaclav Petras wenzeslaus at gmail.com
Fri Jun 20 12:00:33 PDT 2014


On Thu, Jun 19, 2014 at 10:35 AM, <svn_grass at osgeo.org> wrote:

> Use subprocess.Popen() directly for calling g.parser
>
> Glynn, please provide reasoning for this change, especially its first
line, since it is not in commit message and the motivation for this change
is spread over several threads.

Comment is the source code seems like a good place.

Thanks,
Vaclav


> 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)
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-dev/attachments/20140620/3156293d/attachment.html>


More information about the grass-dev mailing list