From 52f251abc2c62800426ad7eb41a5cfd3daa16db7 Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Sat, 13 Jun 2020 22:00:11 +1000 Subject: [PATCH] Removed workaround for earlier versions --- src/PIL/ImageQt.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/PIL/ImageQt.py b/src/PIL/ImageQt.py index dfe2f80bd..a15f4ab5e 100644 --- a/src/PIL/ImageQt.py +++ b/src/PIL/ImageQt.py @@ -142,12 +142,7 @@ def _toqclass_helper(im): data = im.tobytes("raw", "BGRX") format = QImage.Format_RGB32 elif im.mode == "RGBA": - try: - data = im.tobytes("raw", "BGRA") - except SystemError: - # workaround for earlier versions - r, g, b, a = im.split() - im = Image.merge("RGBA", (b, g, r, a)) + data = im.tobytes("raw", "BGRA") format = QImage.Format_ARGB32 else: raise ValueError("unsupported image mode %r" % im.mode)