Skip to content

Commit

Permalink
Mock tornado for jupyterlite
Browse files Browse the repository at this point in the history
  • Loading branch information
martinRenou committed Oct 19, 2021
1 parent 76111ce commit e5b2cf9
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions ipympl/backend_nbagg.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
"""Interactive figures in the Jupyter notebook"""

import sys
import types

# In the case of a pyodide context (JupyterLite)
# we mock Tornado, as it cannot be imported and would
# lead to errors
try:
import micropip # noqa
except ImportError:
sys.modules['tornado'] = types.ModuleType('tornadofake')

import io
import json
from base64 import b64encode
Expand Down

0 comments on commit e5b2cf9

Please sign in to comment.