Pārlūkot izejas kodu

pygrass: fix Geo init, set attrs as last thing and only if cat is set

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@65954 15284696-431f-4ddb-bdfa-cd5b030d7da7
Pietro Zambelli 9 gadi atpakaļ
vecāks
revīzija
d5bca24fca
1 mainītis faili ar 5 papildinājumiem un 5 dzēšanām
  1. 5 5
      lib/python/pygrass/vector/geometry.py

+ 5 - 5
lib/python/pygrass/vector/geometry.py

@@ -278,14 +278,14 @@ class Geo(object):
         else:
             self.c_cats = c_cats
 
-        # set the attributes
-        self.attrs = None
-        if table is not None:
-            self.attrs = Attrs(self.cat, table, writable)
-
         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 and self.cat is not None:
+            self.attrs = Attrs(self.cat, table, writable)
+
     @property
     def cat(self):
         if self.c_cats.contents.cat: