Skip to content

Commit 0b3f7b9

Browse files
committed
Deal with the case that no kernel executable is available
1 parent cf58a7b commit 0b3f7b9

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/sage/repl/ipython_kernel/install.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,12 @@ def check(cls):
264264
import sys
265265
import shutil
266266
from pathlib import Path
267-
if Path(shutil.which(spec.argv[0])).resolve() != Path(sys.executable).resolve():
267+
kernel_executable = shutil.which(spec.argv[0])
268+
if not kernel_executable:
269+
warnings.warn(f'The kernel named {ident} does not seem to be runnable; '
270+
'check your Jupyter configuration '
271+
'(see https://docs.jupyter.org/en/latest/use/jupyter-directories.html).')
272+
if Path(kernel_executable).resolve() != Path(sys.executable).resolve():
268273
warnings.warn(f'The kernel named {ident} does not seem to correspond to this '
269274
'installation of SageMath; check your Jupyter configuration '
270275
'(see https://docs.jupyter.org/en/latest/use/jupyter-directories.html).')

0 commit comments

Comments
 (0)