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):
265
265
266
266
@classmethod
267
267
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
+
268
276
if cls .started :
269
277
return
270
278
@@ -306,8 +314,12 @@ def ipython_inline_display(figure):
306
314
import tornado .template
307
315
308
316
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 ()
311
323
312
324
fignum = figure .number
313
325
tpl = Path (core .FigureManagerWebAgg .get_static_file_path (),
You can’t perform that action at this time.
0 commit comments