Skip to content

Commit e5b2cf9

Browse files
committed
Mock tornado for jupyterlite
1 parent 76111ce commit e5b2cf9

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

‎ipympl/backend_nbagg.py‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
"""Interactive figures in the Jupyter notebook"""
22

3+
import sys
4+
import types
5+
6+
# In the case of a pyodide context (JupyterLite)
7+
# we mock Tornado, as it cannot be imported and would
8+
# lead to errors
9+
try:
10+
import micropip # noqa
11+
except ImportError:
12+
sys.modules['tornado'] = types.ModuleType('tornadofake')
13+
314
import io
415
import json
516
from base64 import b64encode

0 commit comments

Comments
 (0)