Skip to content

Commit 2b5eaec

Browse files
ydl7Yuri Lensky
authored and
Yuri Lensky
committed
Skip headers from jupyter kernelspec list.
1 parent 0480c47 commit 2b5eaec

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

jupyter-kernelspec.el

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,10 @@ REFRESH."
7676
(or (and (not refresh) (gethash host jupyter--kernelspecs))
7777
(let ((specs
7878
(plist-get
79-
(let ((json (or (jupyter-command "kernelspec" "list"
80-
"--json" "--log-level" "ERROR")
79+
(let ((json (or (let* ((jupyter-output (jupyter-command "kernelspec" "list"
80+
"--json" "--log-level" "ERROR"))
81+
(json-start (string-match-p (rx line-start "{") jupyter-output)))
82+
(and json-start (substring jupyter-output json-start)))
8183
(error "\
8284
Can't obtain kernelspecs from jupyter shell command"))))
8385
(condition-case nil

0 commit comments

Comments
 (0)