mirror of
https://github.com/evennia/evennia.git
synced 2026-03-24 00:36:30 +01:00
Fixed Attributehandler.get() default return value.
This commit is contained in:
parent
c402f9424c
commit
4ab5e2aa22
1 changed files with 8 additions and 1 deletions
|
|
@ -251,6 +251,13 @@ class AttributeHandler(object):
|
|||
checked before displaying each looked-after Attribute. If no
|
||||
accessing_obj is given, no check will be done.
|
||||
"""
|
||||
|
||||
class RetDefault(object):
|
||||
"Holds default values"
|
||||
def __init__(self):
|
||||
self.value = default
|
||||
self.strvalue = str(default)
|
||||
|
||||
if self._cache is None or not _TYPECLASS_AGGRESSIVE_CACHE:
|
||||
self._recache()
|
||||
ret = []
|
||||
|
|
@ -270,7 +277,7 @@ class AttributeHandler(object):
|
|||
if raise_exception:
|
||||
raise AttributeError
|
||||
else:
|
||||
ret.append(default)
|
||||
ret.append(RetDefault())
|
||||
if accessing_obj:
|
||||
# check 'attrread' locks
|
||||
ret = [attr for attr in ret if attr.access(accessing_obj, self._attrread, default=default_access)]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue