mirror of
https://github.com/stevenrobertson/cuburn.git
synced 2025-02-05 11:40:04 -05:00
Use AttributeError in _AttrDict
This commit is contained in:
parent
1f827214d2
commit
b29261771b
@ -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):
|
||||||
|
Loading…
Reference in New Issue
Block a user