diff options
author | Lance Stout <lancestout@gmail.com> | 2012-07-06 11:05:47 -0700 |
---|---|---|
committer | Lance Stout <lancestout@gmail.com> | 2012-07-06 11:05:47 -0700 |
commit | 6819b57353cd7d2f7f7b2b31fb849f1c0a566f00 (patch) | |
tree | e523f2f64cc849e64a32518263d264c7af0962cd /sleekxmpp/thirdparty | |
parent | 88b5e60807d5e07e4da1a07042d3b66fe9e98701 (diff) | |
download | slixmpp-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')
-rw-r--r-- | sleekxmpp/thirdparty/suelta/util.py | 3 |
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) |