mirror of
https://github.com/vale981/emacs-jupyter
synced 2025-03-05 07:41:37 -05:00
jupyter-available-kernelspecs: Handle parsing kernelspecs better
Raise an error when `jupyter kernelspec list --json` doesn't return valid JSON.
This commit is contained in:
parent
11ace8c805
commit
e548c6cdbb
1 changed files with 14 additions and 3 deletions
|
@ -76,9 +76,20 @@ REFRESH."
|
|||
(or (and (not refresh) (gethash host jupyter--kernelspecs))
|
||||
(let ((specs
|
||||
(plist-get
|
||||
(jupyter-read-plist-from-string
|
||||
(or (jupyter-command "kernelspec" "list" "--json" "--log-level" "ERROR")
|
||||
(error "Can't obtain kernelspecs from jupyter shell command")))
|
||||
(let ((json (or (jupyter-command "kernelspec" "list"
|
||||
"--json" "--log-level" "ERROR")
|
||||
(error "\
|
||||
Can't obtain kernelspecs from jupyter shell command"))))
|
||||
(condition-case nil
|
||||
(jupyter-read-plist-from-string json)
|
||||
(error
|
||||
(error "\
|
||||
Jupyter kernelspecs couldn't be parsed from
|
||||
|
||||
jupyter kernelspec list --json
|
||||
|
||||
To investiagate further, run that command in a shell and examine
|
||||
why it isn't returning valid JSON."))))
|
||||
:kernelspecs)))
|
||||
(puthash
|
||||
host
|
||||
|
|
Loading…
Add table
Reference in a new issue