@@ -170,24 +170,19 @@ See https://github.com/conda/conda/blob/master/CHANGELOG.md#484-2020-08-06."
170
170
(defun conda--call-json (&rest args )
171
171
" Call Conda with ARGS, assuming we return JSON."
172
172
(let* ((conda (conda--get-executable-path))
173
- (fmt (format " shell.%s +json " (if (eq system-type 'windows-nt ) " cmd.exe" " posix" )))
174
- (process-file-args (append (list conda nil t nil ) args))
175
- (output (with-output-to-string
176
- (with-current-buffer
177
- standard-output
178
- (apply #'process-file process-file-args)))))
173
+ (output (with-temp-buffer
174
+ ; ; We set the `destination' to ignore stderr -- this may come
175
+ ; ; back to bite us if anything important is communicated
176
+ ; ; there
177
+ (apply #'call-process
178
+ (append (list conda nil '(t nil ) nil ) args))
179
+ (buffer-string ))))
179
180
(condition-case err
180
- ; ; (if (version< emacs-version "27.1")
181
- ; ; (json-read-from-string output)
182
- ; ; (json-parse-string output :object-type 'alist :null-object nil))
183
- (if (progn
184
- (require 'json )
185
- (fboundp 'json-parse-string ))
186
- (json-parse-string output :object-type 'alist :null-object nil )
181
+ (if (and (require 'json ) (fboundp 'json-parse-string ))
182
+ (json-parse-string output :object-type 'alist :null-object nil )
187
183
(json-read-from-string output))
188
184
(error " Could not parse %s as JSON: %s " output err))))
189
185
190
-
191
186
(defvar conda--config nil
192
187
" Cached copy of configuration that Conda sees (including `condarc' , etc).
193
188
Set for the lifetime of the process." )
0 commit comments