[GRASS-SVN] r65791 - grass/trunk/lib/python/script
svn_grass at osgeo.org
svn_grass at osgeo.org
Wed Jul 29 07:10:09 PDT 2015
Author: zarch
Date: 2015-07-29 07:10:09 -0700 (Wed, 29 Jul 2015)
New Revision: 65791
Modified:
grass/trunk/lib/python/script/setup.py
Log:
scipt:setup add python3 support
Modified: grass/trunk/lib/python/script/setup.py
===================================================================
--- grass/trunk/lib/python/script/setup.py 2015-07-29 14:09:02 UTC (rev 65790)
+++ grass/trunk/lib/python/script/setup.py 2015-07-29 14:10:09 UTC (rev 65791)
@@ -101,11 +101,11 @@
def write_gisrc(dbase, location, mapset):
"""Write the ``gisrc`` file and return its path."""
- fd, gisrc = tmpfile.mkstemp()
- os.write(fd, "GISDBASE: %s\n" % dbase)
- os.write(fd, "LOCATION_NAME: %s\n" % location)
- os.write(fd, "MAPSET: %s\n" % mapset)
- os.close(fd)
+ gisrc = tmpfile.mktemp()
+ with open(gisrc, 'w') as rc:
+ rc.write("GISDBASE: %s\n" % dbase)
+ rc.write("LOCATION_NAME: %s\n" % location)
+ rc.write("MAPSET: %s\n" % mapset)
return gisrc
More information about the grass-commit
mailing list