mirror of
https://github.com/vale981/emacs-jupyter
synced 2025-03-05 23:41:38 -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))
|
(or (and (not refresh) (gethash host jupyter--kernelspecs))
|
||||||
(let ((specs
|
(let ((specs
|
||||||
(plist-get
|
(plist-get
|
||||||
(jupyter-read-plist-from-string
|
(let ((json (or (jupyter-command "kernelspec" "list"
|
||||||
(or (jupyter-command "kernelspec" "list" "--json" "--log-level" "ERROR")
|
"--json" "--log-level" "ERROR")
|
||||||
(error "Can't obtain kernelspecs from jupyter shell command")))
|
(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)))
|
:kernelspecs)))
|
||||||
(puthash
|
(puthash
|
||||||
host
|
host
|
||||||
|
|
Loading…
Add table
Reference in a new issue