File tree Expand file tree Collapse file tree 1 file changed +15
-2
lines changed
Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -245,6 +245,14 @@ def random_ports(port, n):
245245
246246 @classmethod
247247 def start (cls ):
248+ try :
249+ import asyncio
250+ asyncio .get_running_loop ()
251+ except :
252+ pass
253+ else :
254+ cls .started = True
255+
248256 if cls .started :
249257 return
250258
@@ -283,11 +291,16 @@ def catch_sigint():
283291
284292
285293def ipython_inline_display (figure ):
294+
286295 import tornado .template
287296
288297 WebAggApplication .initialize ()
289- if not webagg_server_thread .is_alive ():
290- webagg_server_thread .start ()
298+ try :
299+ import asyncio
300+ asyncio .get_running_loop ()
301+ except :
302+ if not webagg_server_thread .is_alive ():
303+ webagg_server_thread .start ()
291304
292305 fignum = figure .number
293306 tpl = Path (core .FigureManagerWebAgg .get_static_file_path (),
You can’t perform that action at this time.
0 commit comments