Skip to content

Commit

Permalink
Skip headers from jupyter kernelspec list.
Browse files Browse the repository at this point in the history
  • Loading branch information
ydl7 authored and Yuri Lensky committed Oct 4, 2023
1 parent 0480c47 commit 2b5eaec
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions jupyter-kernelspec.el
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,10 @@ REFRESH."
(or (and (not refresh) (gethash host jupyter--kernelspecs))
(let ((specs
(plist-get
(let ((json (or (jupyter-command "kernelspec" "list"
"--json" "--log-level" "ERROR")
(let ((json (or (let* ((jupyter-output (jupyter-command "kernelspec" "list"
"--json" "--log-level" "ERROR"))
(json-start (string-match-p (rx line-start "{") jupyter-output)))
(and json-start (substring jupyter-output json-start)))
(error "\
Can't obtain kernelspecs from jupyter shell command"))))
(condition-case nil
Expand Down

0 comments on commit 2b5eaec

Please sign in to comment.