From b3f47f99da7b8ac2221b6bbafc85ae8076f92703 Mon Sep 17 00:00:00 2001 From: Augusto Stoffel Date: Sat, 14 Aug 2021 17:48:45 +0200 Subject: [PATCH] Allow evaluating Python code across machines * python.el (python-shell-send-string): Ensure that the temporary file is created in the host running the Python process. --- lisp/progmodes/python.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index 2557704e40..20299c20d2 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -3085,7 +3085,8 @@ python-shell-send-string (list (read-string "Python command: ") nil t)) (let ((process (or process (python-shell-get-process-or-error msg)))) (if (string-match ".\n+." string) ;Multiline. - (let* ((temp-file-name (python-shell--save-temp-file string)) + (let* ((temp-file-name (with-current-buffer (process-buffer process) + (python-shell--save-temp-file string))) (file-name (or (buffer-file-name) temp-file-name))) (python-shell-send-file file-name process temp-file-name t)) (comint-send-string process string) -- 2.31.1