File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -92,11 +92,15 @@ def _backend_selection():
92
92
if not PyQt5 .QtWidgets .qApp .startingUp ():
93
93
# The mainloop is running.
94
94
rcParams ['backend' ] = 'qt5Agg'
95
- elif ('gtk' in sys .modules
96
- and backend not in ('GTK' , 'GTKAgg' , 'GTKCairo' )
97
- and 'gi.repository.GObject' not in sys .modules ):
98
- import gobject
99
- if gobject .MainLoop ().is_running ():
95
+ elif ('gtk' in sys .modules and
96
+ backend not in ('GTK' , 'GTKAgg' , 'GTKCairo' )):
97
+ if 'gi' in sys .modules :
98
+ from gi .repository import GObject
99
+ ml = GObject .MainLoop
100
+ else :
101
+ import gobject
102
+ ml = gobject .MainLoop
103
+ if ml ().is_running ():
100
104
rcParams ['backend' ] = 'gtk' + 'Agg' * is_agg_backend
101
105
elif 'Tkinter' in sys .modules and not backend == 'TkAgg' :
102
106
# import Tkinter
You can’t perform that action at this time.
0 commit comments