File tree Expand file tree Collapse file tree 1 file changed +3
-13
lines changed
Expand file tree Collapse file tree 1 file changed +3
-13
lines changed Original file line number Diff line number Diff line change 11import functools
2- import importlib
32import os
43import signal
54import sys
@@ -100,18 +99,9 @@ def _create_qApp():
10099 if qApp is None :
101100 app = QtWidgets .QApplication .instance ()
102101 if app is None :
103- # check for DISPLAY env variable on X11 build of Qt
104- if QtCore .qVersion () >= "5." :
105- try :
106- importlib .import_module (
107- # i.e. PyQt5.QtX11Extras or PySide2.QtX11Extras.
108- f"{ QtWidgets .__package__ } .QtX11Extras" )
109- is_x11_build = True
110- except ImportError :
111- is_x11_build = False
112- else :
113- is_x11_build = hasattr (QtGui , "QX11Info" )
114- if is_x11_build and not mpl ._c_internal_utils .display_is_valid ():
102+ # display_is_valid returns False only if on Linux and neither X11
103+ # nor Wayland display can be opened.
104+ if not mpl ._c_internal_utils .display_is_valid ():
115105 raise RuntimeError ('Invalid DISPLAY variable' )
116106 try :
117107 QtWidgets .QApplication .setAttribute (
You can’t perform that action at this time.
0 commit comments