浏览代码

pygrass: use getenv from utils to decode bytes, see https://trac.osgeo.org/grass/ticket/3811

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@74383 15284696-431f-4ddb-bdfa-cd5b030d7da7
Anna Petrášová 6 年之前
父节点
当前提交
a0b15b8bb4
共有 1 个文件被更改,包括 4 次插入4 次删除
  1. 4 4
      lib/python/pygrass/gis/__init__.py

+ 4 - 4
lib/python/pygrass/gis/__init__.py

@@ -12,7 +12,7 @@ import fnmatch
 
 import grass.lib.gis as libgis
 from grass.pygrass.errors import GrassError
-from grass.script.utils import encode, decode
+from grass.script.utils import encode, decode, getenv
 
 test_vector_name = "Gis_test_vector"
 test_raster_name = "Gis_test_raster"
@@ -369,9 +369,9 @@ class Mapset(object):
 
     def is_current(self):
         """Check if the MAPSET is the working MAPSET"""
-        return (self.name == libgis.G_getenv('MAPSET') and
-                self.location == libgis.G_getenv('LOCATION_NAME') and
-                self.gisdbase == libgis.G_getenv('GISDBASE'))
+        return (self.name == getenv('MAPSET') and
+                self.location == getenv('LOCATION_NAME') and
+                self.gisdbase == getenv('GISDBASE'))
 
     def current(self):
         """Set the mapset as current"""