Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 26ffec5

Browse filesBrowse files
NelleVQuLogic
authored andcommitted
Merge pull request matplotlib#8149 from anntzer/DISPLAY-check-on-PyQt5
Fix check for DISPLAY on PyQt5.
1 parent a003902 commit 26ffec5
Copy full SHA for 26ffec5

File tree

Expand file treeCollapse file tree

1 file changed

+9
-1
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+9
-1
lines changed

‎lib/matplotlib/backends/backend_qt5.py

Copy file name to clipboardExpand all lines: lib/matplotlib/backends/backend_qt5.py
+9-1Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,15 @@ def _create_qApp():
130130
app = QtWidgets.QApplication.instance()
131131
if app is None:
132132
# check for DISPLAY env variable on X11 build of Qt
133-
if hasattr(QtGui, "QX11Info"):
133+
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:
134142
display = os.environ.get('DISPLAY')
135143
if display is None or not re.search(r':\d', display):
136144
raise RuntimeError('Invalid DISPLAY variable')

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.