(python-shell-prompt-detect): Use unwind-protect to try and not leave
file behind in case of error.
;; carriage returns in unbuffered mode.
(let ((inhibit-eol-conversion (getenv "PYTHONUNBUFFERED")))
(python-shell--save-temp-file code))))
- ;; Use `process-file' as it is remote-host friendly.
- (process-file
- interpreter
- code-file
- '(t nil)
- nil
- interpreter-arg)
- ;; Try to cleanup
- (delete-file code-file)))
+ (unwind-protect
+ ;; Use `process-file' as it is remote-host friendly.
+ (process-file
+ interpreter
+ code-file
+ '(t nil)
+ nil
+ interpreter-arg)
+ ;; Try to cleanup
+ (delete-file code-file))))
(buffer-string)))
(prompts
(catch 'prompts