Runnable with both Python3 and Python2, with PyQt4 #2249
|
@ -5,6 +5,8 @@ def ustr(v):
|
|||
if six.PY3:
|
||||
if isinstance(v, str):
|
||||
return v
|
||||
elif isinstance(v, bytes):
|
||||
return v.decode("utf-8", "replace")
|
||||
else:
|
||||
return str(v)
|
||||
# assume six.PY2
|
||||
|
|
Reference in New Issue
Block a user