Fixed casting to benedict to all dicts returned by any public method on Python 2.7.
This commit is contained in:
parent
16a1f6efec
commit
f8b19017ce
|
@ -14,13 +14,13 @@ class benedict(KeypathDict, ParseDict):
|
|||
|
||||
def __getattribute__(self, name):
|
||||
attr = super(benedict, self).__getattribute__(name)
|
||||
if hasattr(attr, '__call__'):
|
||||
if name.startswith('_'):
|
||||
return attr
|
||||
elif hasattr(attr, '__call__'):
|
||||
# print(attr, name)
|
||||
def attr_wrapper(*args, **kwargs):
|
||||
value = attr(*args, **kwargs)
|
||||
if name.startswith('_'):
|
||||
return value
|
||||
else:
|
||||
return benedict._cast(value)
|
||||
return benedict._cast(value)
|
||||
return attr_wrapper
|
||||
else:
|
||||
return attr
|
||||
|
|
Loading…
Reference in New Issue