summaryrefslogtreecommitdiff
path: root/sleekxmpp/util
diff options
context:
space:
mode:
authorLance Stout <lancestout@gmail.com>2012-08-01 09:04:41 -0700
committerLance Stout <lancestout@gmail.com>2012-08-01 09:04:41 -0700
commit267c24c8ef042e6c9a1a5fe46278eee9d04d5e07 (patch)
tree95cab78fd750091810d80ac56f4b14f7d6247878 /sleekxmpp/util
parent1383ca19b50ae7463a1f310f007ed120f811b574 (diff)
downloadslixmpp-267c24c8ef042e6c9a1a5fe46278eee9d04d5e07.tar.gz
slixmpp-267c24c8ef042e6c9a1a5fe46278eee9d04d5e07.tar.bz2
slixmpp-267c24c8ef042e6c9a1a5fe46278eee9d04d5e07.tar.xz
slixmpp-267c24c8ef042e6c9a1a5fe46278eee9d04d5e07.zip
Fix encoding issue in Python3.
Diffstat (limited to 'sleekxmpp/util')
-rw-r--r--sleekxmpp/util/misc_ops.py3
1 files changed, 3 insertions, 0 deletions
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)