Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit cfb0701

Browse files
committed
assign widgets shim as attribute on html shim
needed to keep both `from IPython.html import widgets` and `from IPython.html.widgets import Widget` working
1 parent 22fe0a8 commit cfb0701

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

IPython/html.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,16 @@
1313

1414
from IPython.utils.shimmodule import ShimModule
1515

16-
sys.modules['IPython.html.widgets'] = ShimModule(
16+
_widgets = sys.modules['IPython.html.widgets'] = ShimModule(
1717
src='IPython.html.widgets', mirror='ipython_widgets')
1818

19-
sys.modules['IPython.html'] = ShimModule(
19+
_html = ShimModule(
2020
src='IPython.html', mirror='jupyter_notebook')
2121

22+
# hook up widgets
23+
_html.widgets = _widgets
24+
sys.modules['IPython.html'] = _html
25+
2226
if __name__ == '__main__':
2327
from jupyter_notebook import notebookapp as app
2428
app.launch_new_instance()

0 commit comments

Comments
 (0)