Skip to content

Commit 5a7d3cf

Browse files
To check the kernel type and assign shell value accordingly.
1 parent 1c11ea3 commit 5a7d3cf

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/inspectorscripts.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,11 @@ from IPython.core.magics.namespace import NamespaceMagics
2727
2828
_jupyterlab_variableinspector_nms = NamespaceMagics()
2929
_jupyterlab_variableinspector_Jupyter = get_ipython()
30-
_jupyterlab_variableinspector_nms.shell = _jupyterlab_variableinspector_Jupyter.kernel.shell
30+
# Check kernel implementation
31+
if hasattr(_jupyterlab_variableinspector_Jupyter.kernel, 'shell'):
32+
_jupyterlab_variableinspector_nms.shell = _jupyterlab_variableinspector_Jupyter.kernel.shell
33+
else:
34+
_jupyterlab_variableinspector_nms.shell = _jupyterlab_variableinspector_Jupyter
3135
3236
_jupyterlab_variableinspector_maxitems = 10
3337

0 commit comments

Comments
 (0)