diff --git a/lib/matplotlib/backends/backend_qt5.py b/lib/matplotlib/backends/backend_qt5.py index 0f23b12462a2..71fe6ef61de2 100644 --- a/lib/matplotlib/backends/backend_qt5.py +++ b/lib/matplotlib/backends/backend_qt5.py @@ -130,7 +130,15 @@ def _create_qApp(): app = QtWidgets.QApplication.instance() if app is None: # check for DISPLAY env variable on X11 build of Qt - if hasattr(QtGui, "QX11Info"): + if is_pyqt5(): + try: + from PyQt5 import QtX11Extras + is_x11_build = True + except ImportError: + is_x11_build = False + else: + is_x11_build = hasattr(QtGui, "QX11Info") + if is_x11_build: display = os.environ.get('DISPLAY') if display is None or not re.search(r':\d', display): raise RuntimeError('Invalid DISPLAY variable') pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy