Use six.binary_type to point to the right type

Change-Id: Ia6c54b9e8f4be61bc2457e39f8a6f84b9f73d588
This commit is contained in:
Joshua Harlow 2017-09-19 16:04:21 -07:00
parent 2b36107f0b
commit 75b8af3c9f

View File

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