mirror of
https://github.com/stevenrobertson/cuburn.git
synced 2025-07-11 18:55:26 -04:00
Use AttributeError in _AttrDict
This commit is contained in:
@ -111,7 +111,9 @@ def palette_encode(data, format='rgb8'):
|
|||||||
|
|
||||||
class _AttrDict(dict):
|
class _AttrDict(dict):
|
||||||
def __getattr__(self, name):
|
def __getattr__(self, name):
|
||||||
return self[name]
|
if name in self:
|
||||||
|
return self[name]
|
||||||
|
raise AttributeError('%s not a dict key' % name)
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def _wrap(cls, dct):
|
def _wrap(cls, dct):
|
||||||
|
Reference in New Issue
Block a user