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 1
1
import functools
2
- import importlib
3
2
import os
4
3
import signal
5
4
import sys
@@ -100,18 +99,9 @@ def _create_qApp():
100
99
if qApp is None :
101
100
app = QtWidgets .QApplication .instance ()
102
101
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 ():
115
105
raise RuntimeError ('Invalid DISPLAY variable' )
116
106
try :
117
107
QtWidgets .QApplication .setAttribute (
You can’t perform that action at this time.
0 commit comments