Provide the notebook being imported with "get_ipython"

This commit is contained in:
Pietro Battiston 2015-03-30 11:52:11 +02:00
parent bceab630e7
commit 4eb755872a

View File

@ -39,6 +39,7 @@
},
"outputs": [],
"source": [
"from IPython import get_ipython\n",
"from IPython.nbformat import current\n",
"from IPython.core.interactiveshell import InteractiveShell"
]
@ -138,6 +139,7 @@
" mod = types.ModuleType(fullname)\n",
" mod.__file__ = path\n",
" mod.__loader__ = self\n",
" mod.__dict__['get_ipython'] = get_ipython\n",
" sys.modules[fullname] = mod\n",
" \n",
" # extra work to ensure that magics that would affect the user_ns\n",