[GRASS-SVN] r65954 - grass/trunk/lib/python/pygrass/vector

svn_grass at osgeo.org svn_grass at osgeo.org
Mon Aug 17 23:00:23 PDT 2015


Author: zarch
Date: 2015-08-17 23:00:23 -0700 (Mon, 17 Aug 2015)
New Revision: 65954

Modified:
   grass/trunk/lib/python/pygrass/vector/geometry.py
Log:
pygrass: fix Geo init, set attrs as last thing and only if cat is set

Modified: grass/trunk/lib/python/pygrass/vector/geometry.py
===================================================================
--- grass/trunk/lib/python/pygrass/vector/geometry.py	2015-08-18 05:58:19 UTC (rev 65953)
+++ grass/trunk/lib/python/pygrass/vector/geometry.py	2015-08-18 06:00:23 UTC (rev 65954)
@@ -278,14 +278,14 @@
         else:
             self.c_cats = c_cats
 
-        # set the attributes
+        if self.id and self.c_mapinfo is not None and read:
+            self.read()
+
+        # set the attributes as last thing to do
         self.attrs = None
-        if table is not None:
+        if table is not None and self.cat is not None:
             self.attrs = Attrs(self.cat, table, writable)
 
-        if self.id and self.c_mapinfo is not None and read:
-            self.read()
-
     @property
     def cat(self):
         if self.c_cats.contents.cat:



More information about the grass-commit mailing list