Skip to content

Commit b4be46b

Browse files
committed
Skip headers from jupyter kernelspec list.
1 parent 7d20c0a commit b4be46b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

jupyter-kernelspec.el

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,9 @@ each DIRECTORY will be a remote file name."
6161
(or (and (not refresh) (gethash host jupyter--kernelspecs))
6262
(let ((specs (plist-get
6363
(jupyter-read-plist-from-string
64-
(or (jupyter-command "kernelspec" "list" "--json")
64+
(or (let* ((jupyter-output (jupyter-command "kernelspec" "list" "--json"))
65+
(json-start (string-match-p (rx line-start "{") jupyter-output)))
66+
(and json-start (substring jupyter-output json-start)))
6567
(error "Can't obtain kernelspecs from jupyter shell command")))
6668
:kernelspecs)))
6769
(puthash host

0 commit comments

Comments
 (0)