Use AttributeError in _AttrDict

This commit is contained in:
Steven Robertson 2011-12-18 11:31:18 -05:00
parent 1f827214d2
commit b29261771b

View File

@ -111,7 +111,9 @@ def palette_encode(data, format='rgb8'):
class _AttrDict(dict):
def __getattr__(self, name):
return self[name]
if name in self:
return self[name]
raise AttributeError('%s not a dict key' % name)
@classmethod
def _wrap(cls, dct):