From 267c24c8ef042e6c9a1a5fe46278eee9d04d5e07 Mon Sep 17 00:00:00 2001 From: Lance Stout Date: Wed, 1 Aug 2012 09:04:41 -0700 Subject: Fix encoding issue in Python3. --- sleekxmpp/util/misc_ops.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'sleekxmpp') diff --git a/sleekxmpp/util/misc_ops.py b/sleekxmpp/util/misc_ops.py index 9ed535d9..1dcc2b91 100644 --- a/sleekxmpp/util/misc_ops.py +++ b/sleekxmpp/util/misc_ops.py @@ -19,6 +19,9 @@ def bytes(text): :param text: Unicode text to convert to bytes :rtype: bytes (Python3), str (Python2.6+) """ + if text is None: + return b'' + if sys.version_info < (3, 0): import __builtin__ return __builtin__.bytes(text) -- cgit v1.2.3 From 475ccfa8dcc135934b7beef9826e67eb513bb828 Mon Sep 17 00:00:00 2001 From: Lance Stout Date: Wed, 1 Aug 2012 09:04:58 -0700 Subject: Use correct method for getting channel binding. --- sleekxmpp/features/feature_mechanisms/mechanisms.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sleekxmpp') diff --git a/sleekxmpp/features/feature_mechanisms/mechanisms.py b/sleekxmpp/features/feature_mechanisms/mechanisms.py index 0132765f..b5554181 100644 --- a/sleekxmpp/features/feature_mechanisms/mechanisms.py +++ b/sleekxmpp/features/feature_mechanisms/mechanisms.py @@ -99,7 +99,7 @@ class FeatureMechanisms(BasePlugin): result[value] = creds.get('email', jid) elif value == 'channel_binding': if sys.version_info >= (3, 3): - result[value] = self.xmpp.socket.channel_binding() + result[value] = self.xmpp.socket.get_channel_binding() else: result[value] = None elif value == 'host': -- cgit v1.2.3