Fix encoding issue in Python3.

This commit is contained in:
Lance Stout 2012-08-01 09:04:41 -07:00
parent 1383ca19b5
commit 267c24c8ef

View file

@ -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)