Skip to content

Commit 0c04d86

Browse files
lacraig2zestrada
authored andcommitted
fix getkernel
1 parent de99668 commit 0c04d86

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/penguin/utils.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -265,8 +265,6 @@ def get_kernel(conf, proj_dir):
265265
if kernel:
266266
if os.path.exists(kernel) and os.path.isfile(kernel):
267267
return kernel
268-
# If kernel path was set but doesn't exist, treat as unset
269-
kernel = None
270268
from penguin.q_config import load_q_config
271269
from glob import glob
272270
q_config = load_q_config(conf)
@@ -288,6 +286,12 @@ def get_kernel(conf, proj_dir):
288286
options = [i for i in kernels if kernel in i]
289287
if len(options) == 1:
290288
return options[0]
289+
elif len(options) == 0:
290+
logger.warning(f"Kernel input '{kernel}' did not match any of the options.")
291+
else:
292+
logger.warning(f"Kernel '{kernel}' matched {len(options)} options: {options}. It must match exactly one.")
293+
# If kernel path was set but doesn't exist, treat as unset
294+
kernel = None
291295

292296
# For old configurations without kernel specified, try using KernelVersionFinder
293297
if kernel is None:

0 commit comments

Comments
 (0)