Skip to content

Commit ebe48c1

Browse files
committed
fix usage without get_ipython
1 parent 7d52cd7 commit ebe48c1

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/ogdf_python/jupyter.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@
33
import cppyy
44

55
try:
6+
from IPython import get_ipython
67
from IPython.core.magic import register_cell_magic
8+
if not get_ipython():
9+
raise ImportError("cell magic can only be used in context where `get_ipython` exists")
710
except ImportError:
811
pass
912
else:

0 commit comments

Comments
 (0)