Skip to content

Commit 20e4a86

Browse files
ydl7Yuri D. Lensky
authored and
Yuri D. Lensky
committed
Skip headers from jupyter kernelspec list.
1 parent db8a9e2 commit 20e4a86

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
@@ -103,8 +103,10 @@ REFRESH."
103103
(or (and (not refresh) (jupyter-kernelspecs-cache-get host))
104104
(let ((specs
105105
(plist-get
106-
(let ((json (or (jupyter-command "kernelspec" "list"
107-
"--json" "--log-level" "ERROR")
106+
(let ((json (or (let* ((jupyter-output (jupyter-command "kernelspec" "list"
107+
"--json" "--log-level" "ERROR"))
108+
(json-start (string-match-p (rx line-start "{") jupyter-output)))
109+
(and json-start (substring jupyter-output json-start)))
108110
(error "\
109111
Can't obtain kernelspecs from jupyter shell command"))))
110112
(condition-case nil

0 commit comments

Comments
 (0)