raise AttributeError if accessing invalid Entity attribute
Using 'hasattr' against the Entity class will not work properly unless
the Entity's __getattr__ method raises an AttributeError when the
attribute is not present.
This closes
@@ -81,7 +81,9 @@ class EntityBase(object):
return self.attributes[name]
def __getattr__(self, name):
+ if name in self.attributes:
return self.attributes[name]
+ raise AttributeError
def __contains__(self, name):
return name in self.attributes
