summaryrefslogtreecommitdiff
path: root/sleekxmpp/thirdparty/suelta/util.py
diff options
context:
space:
mode:
authorLance Stout <lancestout@gmail.com>2012-07-06 11:05:47 -0700
committerLance Stout <lancestout@gmail.com>2012-07-06 11:05:47 -0700
commit6819b57353cd7d2f7f7b2b31fb849f1c0a566f00 (patch)
treee523f2f64cc849e64a32518263d264c7af0962cd /sleekxmpp/thirdparty/suelta/util.py
parent88b5e60807d5e07e4da1a07042d3b66fe9e98701 (diff)
downloadslixmpp-6819b57353cd7d2f7f7b2b31fb849f1c0a566f00.tar.gz
slixmpp-6819b57353cd7d2f7f7b2b31fb849f1c0a566f00.tar.bz2
slixmpp-6819b57353cd7d2f7f7b2b31fb849f1c0a566f00.tar.xz
slixmpp-6819b57353cd7d2f7f7b2b31fb849f1c0a566f00.zip
Handle converting None to byte data (b'').
Diffstat (limited to 'sleekxmpp/thirdparty/suelta/util.py')
-rw-r--r--sleekxmpp/thirdparty/suelta/util.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/sleekxmpp/thirdparty/suelta/util.py b/sleekxmpp/thirdparty/suelta/util.py
index 7d822a81..cd2439d5 100644
--- a/sleekxmpp/thirdparty/suelta/util.py
+++ b/sleekxmpp/thirdparty/suelta/util.py
@@ -15,6 +15,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)