Merge pull request #1942 from python-pillow/pyqt4-pyqt5

Fix for program importing PyQt4 when PyQt5 also installed
This commit is contained in:
wiredfool 2016-06-25 12:16:16 +01:00 committed by GitHub
commit 8d8990a9d4

View File

@ -26,12 +26,12 @@ 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
qt_version = '4'
except ImportError:
except (ImportError, RuntimeError):
try:
from PySide.QtGui import QImage, qRgba, QPixmap
from PySide.QtCore import QBuffer, QIODevice