From 2d44b957a8247ff654e8876d8e9a4a720ca3d08d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=2E=20Armando=20Sol=C3=A9?= Date: Tue, 7 May 2019 15:00:02 +0200 Subject: [PATCH] Update qt_compat.py Perform proper test. --- 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