From bfc439fbaa5579f1af2b947554bae1b7a8037310 Mon Sep 17 00:00:00 2001 From: Thomas A Caswell Date: Sat, 11 May 2019 19:24:28 -0400 Subject: [PATCH] Backport PR #14153: Update qt_compat.py test for already imported binding. --- lib/matplotlib/backends/qt_compat.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/matplotlib/backends/qt_compat.py b/lib/matplotlib/backends/qt_compat.py index 1198305aea73..6b52284fe7f4 100644 --- a/lib/matplotlib/backends/qt_compat.py +++ b/lib/matplotlib/backends/qt_compat.py @@ -30,13 +30,13 @@ "pyqt": QT_API_PYQTv2, "pyside": QT_API_PYSIDE, None: None} # First, check if anything is already imported. -if "PyQt5" in sys.modules: +if "PyQt5.QtCore" in sys.modules: QT_API = QT_API_PYQT5 -elif "PySide2" in sys.modules: +elif "PySide2.QtCore" in sys.modules: QT_API = QT_API_PYSIDE2 -elif "PyQt4" in sys.modules: +elif "PyQt4.QtCore" in sys.modules: QT_API = QT_API_PYQTv2 -elif "PySide" in sys.modules: +elif "PySide.QtCore" in sys.modules: QT_API = QT_API_PYSIDE # Otherwise, check the QT_API environment variable (from Enthought). This can # only override the binding, not the backend (in other words, we check that the