Replace unicode with six.text_type

The unicode() built-in does not exist under Python 3 so use
six.text_type, which is set correctly to str or unicode, instead.

Change-Id: I4e2a4b10dfaa8703525df7d5a6892487698657da
This commit is contained in:
Vu Cong Tuan 2018-07-05 11:17:34 +07:00
parent 8ffe276b60
commit bfeb995fb9

View File

@ -55,7 +55,7 @@ def get_function_name(func):
def _encode(src):
"""remove extra 'u' in PY2."""
if six.PY2 and isinstance(src, unicode):
if six.PY2 and isinstance(src, six.text_type):
return src.encode('utf-8')
return src