Welcome to mirror list, hosted at ThFree Co, Russian Federation.

dev.gajim.org/gajim/python-nbxmpp.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilipp Hörist <philipp@hoerist.com>2019-08-29 20:39:28 +0300
committerPhilipp Hörist <philipp@hoerist.com>2019-08-29 20:41:34 +0300
commite57118fd4a8a1b53cb1fc42a7d4253078e5d55e0 (patch)
tree88fa5d263305fb203c042caa2dd1bb1d7d6d0a4e /nbxmpp/modules
parent33ca00424f8d2e106715a02069766be608d8843d (diff)
Cast exceptions to str
Diffstat (limited to 'nbxmpp/modules')
-rw-r--r--nbxmpp/modules/omemo.py4
-rw-r--r--nbxmpp/modules/user_avatar.py3
2 files changed, 4 insertions, 3 deletions
diff --git a/nbxmpp/modules/omemo.py b/nbxmpp/modules/omemo.py
index 39716da..b184db9 100644
--- a/nbxmpp/modules/omemo.py
+++ b/nbxmpp/modules/omemo.py
@@ -221,7 +221,7 @@ class OMEMO:
return self._parse_devicelist(item)
except StanzaMalformed as error:
return raise_error(log.warning, stanza,
- 'stanza-malformed', error)
+ 'stanza-malformed', str(error))
def set_bundle(self, bundle, device_id):
item = self._create_bundle(bundle)
@@ -301,7 +301,7 @@ class OMEMO:
return self._parse_bundle(item)
except StanzaMalformed as error:
return raise_error(log.warning, stanza,
- 'stanza-malformed', error)
+ 'stanza-malformed', str(error))
@staticmethod
def _parse_bundle(item):
diff --git a/nbxmpp/modules/user_avatar.py b/nbxmpp/modules/user_avatar.py
index 951d580..80b86c9 100644
--- a/nbxmpp/modules/user_avatar.py
+++ b/nbxmpp/modules/user_avatar.py
@@ -112,7 +112,8 @@ class UserAvatar:
try:
data = base64.b64decode(data.encode('utf-8'))
except Exception as error:
- return raise_error(log.warning, stanza, 'stanza-malformed', error)
+ return raise_error(log.warning, stanza,
+ 'stanza-malformed', str(error))
log.info('Received avatar data: %s %s', jid, sha)
return AvatarData(jid, sha, data)