We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a003902 commit 26ffec5Copy full SHA for 26ffec5
lib/matplotlib/backends/backend_qt5.py
@@ -130,7 +130,15 @@ def _create_qApp():
130
app = QtWidgets.QApplication.instance()
131
if app is None:
132
# check for DISPLAY env variable on X11 build of Qt
133
- if hasattr(QtGui, "QX11Info"):
+ if is_pyqt5():
134
+ try:
135
+ from PyQt5 import QtX11Extras
136
+ is_x11_build = True
137
+ except ImportError:
138
+ is_x11_build = False
139
+ else:
140
+ is_x11_build = hasattr(QtGui, "QX11Info")
141
+ if is_x11_build:
142
display = os.environ.get('DISPLAY')
143
if display is None or not re.search(r':\d', display):
144
raise RuntimeError('Invalid DISPLAY variable')
0 commit comments