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 Jan 19, 2024
1 parent da306a6 commit 7714654
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 @@ -103,8 +103,10 @@ REFRESH."
(or (and (not refresh) (jupyter-kernelspecs-cache-get host))
(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 7714654

Please sign in to comment.