Merge pull request #1218 from radarhere/qt-compatibility

Adjusted ImageQt use of unicode() for 2/3 compatibility
This commit is contained in:
wiredfool 2015-06-16 11:58:28 -07:00
commit d8c1add604

View File

@ -59,7 +59,10 @@ class ImageQt(QImage):
# handle filename, if given instead of image name
if hasattr(im, "toUtf8"):
# FIXME - is this really the best way to do this?
im = unicode(im.toUtf8(), "utf-8")
if str is bytes:
im = unicode(im.toUtf8(), "utf-8")
else:
im = str(im.toUtf8(), "utf-8")
if isPath(im):
im = Image.open(im)