Fix for program importing PyQt4 when PyQt5 also installed

Fixes https://github.com/python-pillow/Pillow/issues/1939 using suggested solution.
This commit is contained in:
Hugo 2016-06-07 16:17:20 +03:00
parent 4cca857b1e
commit 1d47ff5f4d

View File

@ -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