Merge "Use six.binary_type to point to the right type"

This commit is contained in:
Jenkins 2017-09-20 20:30:02 +00:00 committed by Gerrit Code Review
commit 7d967d94c8

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