Adjusted ImageQt use of unicode() for 2/3 compatibility

This commit is contained in:
Andrew Murray 2015-05-07 21:47:08 +10:00
parent 414c3f8b3a
commit 3d52e797f8

View File

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