Skip to content

Commit

Permalink
Merge pull request #137 from martibosch/if-json
Browse files Browse the repository at this point in the history
fix: check if json-parse-string available (instead of emacs version)
  • Loading branch information
necaris authored Nov 7, 2022
2 parents cb9544e + a9f1122 commit 2af92fe
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions conda.el
Original file line number Diff line number Diff line change
Expand Up @@ -168,9 +168,14 @@ ANACONDA_HOME environment variable."
standard-output
(apply #'process-file process-file-args)))))
(condition-case err
(if (version< emacs-version "27.1")
(json-read-from-string output)
(json-parse-string output :object-type 'alist :null-object nil))
;; (if (version< emacs-version "27.1")
;; (json-read-from-string output)
;; (json-parse-string output :object-type 'alist :null-object nil))
(if (progn
(require 'json)
(fboundp 'json-parse-string))
(json-parse-string output :object-type 'alist :null-object nil)
(json-read-from-string output))
(error "Could not parse %s as JSON: %s" output err))))


Expand Down

0 comments on commit 2af92fe

Please sign in to comment.