summaryrefslogtreecommitdiff
path: root/sleekxmpp
diff options
context:
space:
mode:
authorCorrel Roush <correl@gmail.com>2011-12-20 21:19:51 -0500
committerCorrel Roush <correl@gmail.com>2011-12-20 21:19:51 -0500
commite928b9c4341a7f49896ec13c1c4bf325ee708e00 (patch)
tree0c48afe55ef87072fbc8e7097ba3c64984e98975 /sleekxmpp
parent6c58b8cc4bf5556b4df88ab3eb2ed53d164ad8de (diff)
downloadslixmpp-e928b9c4341a7f49896ec13c1c4bf325ee708e00.tar.gz
slixmpp-e928b9c4341a7f49896ec13c1c4bf325ee708e00.tar.bz2
slixmpp-e928b9c4341a7f49896ec13c1c4bf325ee708e00.tar.xz
slixmpp-e928b9c4341a7f49896ec13c1c4bf325ee708e00.zip
XEP-0009: Updated tests to work in python 3
Diffstat (limited to 'sleekxmpp')
-rw-r--r--sleekxmpp/plugins/xep_0009/binding.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/sleekxmpp/plugins/xep_0009/binding.py b/sleekxmpp/plugins/xep_0009/binding.py
index 2c54b3b1..b4395707 100644
--- a/sleekxmpp/plugins/xep_0009/binding.py
+++ b/sleekxmpp/plugins/xep_0009/binding.py
@@ -111,10 +111,10 @@ def _xml2py(value):
if value.find('{%s}double' % namespace) is not None:
return float(value.find('{%s}double' % namespace).text)
if value.find('{%s}base64' % namespace) is not None:
- return rpcbase64(value.find('{%s}base64' % namespace).text)
+ return rpcbase64(value.find('{%s}base64' % namespace).text.encode())
if value.find('{%s}Base64' % namespace) is not None:
# Older versions of XEP-0009 used Base64
- return rpcbase64(value.find('{%s}Base64' % namespace).text)
+ return rpcbase64(value.find('{%s}Base64' % namespace).text.encode())
if value.find('{%s}dateTime.iso8601' % namespace) is not None:
return rpctime(value.find('{%s}dateTime.iso8601' % namespace).text)
if value.find('{%s}struct' % namespace) is not None:
@@ -138,13 +138,13 @@ class rpcbase64(object):
self.data = data
def decode(self):
- return base64.decodestring(self.data)
+ return base64.b64decode(self.data)
def __str__(self):
- return self.decode()
+ return self.decode().decode()
def encoded(self):
- return self.data
+ return self.data.decode()