Some minor edge-case fixes when using a session as caller.
This commit is contained in:
parent
f12c754225
commit
df74380155
2 changed files with 8 additions and 5 deletions
|
|
@ -81,7 +81,7 @@ class NAttributeHandler(object):
|
|||
"""
|
||||
return key in self._store
|
||||
|
||||
def get(self, key):
|
||||
def get(self, key, default=None):
|
||||
"""
|
||||
Get the named key value.
|
||||
|
||||
|
|
@ -92,7 +92,7 @@ class NAttributeHandler(object):
|
|||
the value of the Nattribute.
|
||||
|
||||
"""
|
||||
return self._store.get(key, None)
|
||||
return self._store.get(key, default)
|
||||
|
||||
def add(self, key, value):
|
||||
"""
|
||||
|
|
@ -376,6 +376,9 @@ class ServerSession(Session):
|
|||
for the protocol(s).
|
||||
|
||||
"""
|
||||
# this can happen if this is triggered e.g. a command.msg
|
||||
# that auto-adds the session, we'd get a kwarg collision.
|
||||
kwargs.pop("session", None)
|
||||
if text is not None:
|
||||
self.data_out(text=text, **kwargs)
|
||||
else:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue