* lisp/progmodes/python.el: Be more careful about temp file removal
(python-shell-prompt-detect): Use unwind-protect to try and not leave file behind in case of error.
This commit is contained in:
parent
b3cab4199a
commit
7a608fc6f3
1 changed files with 10 additions and 9 deletions
|
@ -2266,15 +2266,16 @@ detection and just returns nil."
|
||||||
;; carriage returns in unbuffered mode.
|
;; carriage returns in unbuffered mode.
|
||||||
(let ((inhibit-eol-conversion (getenv "PYTHONUNBUFFERED")))
|
(let ((inhibit-eol-conversion (getenv "PYTHONUNBUFFERED")))
|
||||||
(python-shell--save-temp-file code))))
|
(python-shell--save-temp-file code))))
|
||||||
;; Use `process-file' as it is remote-host friendly.
|
(unwind-protect
|
||||||
(process-file
|
;; Use `process-file' as it is remote-host friendly.
|
||||||
interpreter
|
(process-file
|
||||||
code-file
|
interpreter
|
||||||
'(t nil)
|
code-file
|
||||||
nil
|
'(t nil)
|
||||||
interpreter-arg)
|
nil
|
||||||
;; Try to cleanup
|
interpreter-arg)
|
||||||
(delete-file code-file)))
|
;; Try to cleanup
|
||||||
|
(delete-file code-file))))
|
||||||
(buffer-string)))
|
(buffer-string)))
|
||||||
(prompts
|
(prompts
|
||||||
(catch 'prompts
|
(catch 'prompts
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue