Merge "Use six.binary_type to point to the right type"
This commit is contained in:
commit
7d967d94c8
@ -111,7 +111,7 @@ def to_utf8(text):
|
||||
|
||||
.. versionadded:: 3.5
|
||||
"""
|
||||
if isinstance(text, bytes):
|
||||
if isinstance(text, six.binary_type):
|
||||
return text
|
||||
elif isinstance(text, six.text_type):
|
||||
return text.encode('utf-8')
|
||||
|
Loading…
x
Reference in New Issue
Block a user