Use six.binary_type to point to the right type
Change-Id: Ia6c54b9e8f4be61bc2457e39f8a6f84b9f73d588
This commit is contained in:
parent
2b36107f0b
commit
75b8af3c9f
@ -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…
Reference in New Issue
Block a user