From 3d52e797f87d36f011079c00670985a609aa2fe6 Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Thu, 7 May 2015 21:47:08 +1000 Subject: [PATCH] Adjusted ImageQt use of unicode() for 2/3 compatibility --- PIL/ImageQt.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/PIL/ImageQt.py b/PIL/ImageQt.py index 1723e3226..6b7d4d66e 100644 --- a/PIL/ImageQt.py +++ b/PIL/ImageQt.py @@ -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)