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:
parent
8ffe276b60
commit
bfeb995fb9
@ -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
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user