1. Curtis Maloney
  2. gnocchi-tools

Commits

funkybob  committed daababb Draft

Don't allow Attrs to block native attributes

  • Participants
  • Parent commits 371ec45
  • Branches default

Comments (0)

Files changed (1)

File gnocchi/tools/attr.py

View file
  • Ignore whitespace
             )
 
     def __getitem__( self, key ):
-        self._load_cache()
-        return self._attributes[key]
+        try:
+            return getattr(self, key)
+        except AttributeError:
+            self._load_cache()
+            return self._attributes[key]
 
     def __setitem__( self, key, value ):
         try: