File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed
Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -265,6 +265,14 @@ def random_ports(port, n):
265265
266266 @classmethod
267267 def start (cls ):
268+ import asyncio
269+ try :
270+ asyncio .get_running_loop ()
271+ except RuntimeError :
272+ pass
273+ else :
274+ cls .started = True
275+
268276 if cls .started :
269277 return
270278
@@ -306,8 +314,12 @@ def ipython_inline_display(figure):
306314 import tornado .template
307315
308316 WebAggApplication .initialize ()
309- if not webagg_server_thread .is_alive ():
310- webagg_server_thread .start ()
317+ import asyncio
318+ try :
319+ asyncio .get_running_loop ()
320+ except RuntimeError :
321+ if not webagg_server_thread .is_alive ():
322+ webagg_server_thread .start ()
311323
312324 fignum = figure .number
313325 tpl = Path (core .FigureManagerWebAgg .get_static_file_path (),
You can’t perform that action at this time.
0 commit comments