summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmmanuel Gil Peyrot <linkmauve@linkmauve.fr>2015-09-05 18:35:59 +0100
committerEmmanuel Gil Peyrot <linkmauve@linkmauve.fr>2015-09-05 18:35:59 +0100
commit27f98bf22c2b95b3aa39719fe7fed3db6506213a (patch)
tree238180d4129863df386ec096b70846fe377db8f1
parent3978078710774d9675513f0624cde9f1b1ff2615 (diff)
downloadslixmpp-27f98bf22c2b95b3aa39719fe7fed3db6506213a.tar.gz
slixmpp-27f98bf22c2b95b3aa39719fe7fed3db6506213a.tar.bz2
slixmpp-27f98bf22c2b95b3aa39719fe7fed3db6506213a.tar.xz
slixmpp-27f98bf22c2b95b3aa39719fe7fed3db6506213a.zip
xep_0231: Fix a traceback on result serialization.
-rw-r--r--slixmpp/plugins/xep_0231/bob.py3
-rw-r--r--slixmpp/plugins/xep_0231/stanza.py4
2 files changed, 3 insertions, 4 deletions
diff --git a/slixmpp/plugins/xep_0231/bob.py b/slixmpp/plugins/xep_0231/bob.py
index b26eeede..a3b5edd4 100644
--- a/slixmpp/plugins/xep_0231/bob.py
+++ b/slixmpp/plugins/xep_0231/bob.py
@@ -134,8 +134,7 @@ class XEP_0231(BasePlugin):
def _get_bob(self, jid, node, ifrom, cid):
if cid in self._cids:
return self._cids[cid]
- else:
- raise XMPPError('item-not-found')
+ raise XMPPError('item-not-found')
def _del_bob(self, jid, node, ifrom, cid):
if cid in self._cids:
diff --git a/slixmpp/plugins/xep_0231/stanza.py b/slixmpp/plugins/xep_0231/stanza.py
index f7e6a66c..b3b96eff 100644
--- a/slixmpp/plugins/xep_0231/stanza.py
+++ b/slixmpp/plugins/xep_0231/stanza.py
@@ -21,10 +21,10 @@ class BitsOfBinary(ElementBase):
interfaces = set(('cid', 'max_age', 'type', 'data'))
def get_max_age(self):
- return self._get_attr('max-age')
+ return int(self._get_attr('max-age'))
def set_max_age(self, value):
- self._set_attr('max-age', value)
+ self._set_attr('max-age', str(value))
def get_data(self):
return base64.b64decode(bytes(self.xml.text))