Runnable with both Python3 and Python2, with PyQt4 #2249

Open
kashikoibumi wants to merge 60 commits from kashikoibumi/py3 into v0.6
Showing only changes of commit 08650d5e8e - Show all commits

View File

@ -5,6 +5,8 @@ def ustr(v):
if six.PY3: if six.PY3:
if isinstance(v, str): if isinstance(v, str):
return v return v
elif isinstance(v, bytes):
return v.decode("utf-8", "replace")
else: else:
return str(v) return str(v)
# assume six.PY2 # assume six.PY2