Skip to content

Commit 487a1f7

Browse files
committed
Explain IPython kernel check
1 parent 21271cb commit 487a1f7

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

pysrc/juliacall/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,8 +252,12 @@ def jlstr(x):
252252
CONFIG['autoload_extensions'] = choice('autoload_extensions', ['yes', 'no'])[0]
253253
if CONFIG['autoload_extensions'] in {'yes', None}:
254254
try:
255+
# Get IPython `InteractiveShell` instance
255256
get_ipython = sys.modules['IPython'].get_ipython
256257

258+
# This line is a check for the IPython kernel being loaded to the
259+
# interactive shell, so that we don't activate for other types of
260+
# interactive shells).
257261
if 'IPKernelApp' not in get_ipython().config:
258262
raise ImportError('console')
259263

0 commit comments

Comments
 (0)