From 1d47ff5f4d6adc9b718017754a160fc591b16c4b Mon Sep 17 00:00:00 2001 From: Hugo Date: Tue, 7 Jun 2016 16:17:20 +0300 Subject: [PATCH] Fix for program importing PyQt4 when PyQt5 also installed Fixes https://github.com/python-pillow/Pillow/issues/1939 using suggested solution. --- PIL/ImageQt.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PIL/ImageQt.py b/PIL/ImageQt.py index aece9d62a..422638c6f 100644 --- a/PIL/ImageQt.py +++ b/PIL/ImageQt.py @@ -26,7 +26,7 @@ try: from PyQt5.QtGui import QImage, qRgba, QPixmap from PyQt5.QtCore import QBuffer, QIODevice qt_version = '5' -except ImportError: +except (ImportError, RuntimeError): try: from PyQt4.QtGui import QImage, qRgba, QPixmap from PyQt4.QtCore import QBuffer, QIODevice