]> git.eshelyaron.com Git - emacs.git/commitdiff
Allow evaluating Python code across machines
authorAugusto Stoffel <arstoffel@gmail.com>
Sun, 15 Aug 2021 12:00:49 +0000 (14:00 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Sun, 15 Aug 2021 12:00:49 +0000 (14:00 +0200)
* python.el (python-shell-send-string): Ensure that the temporary file
is created in the host running the Python process (bug#50057).

lisp/progmodes/python.el

index 2557704e40301257b8576bf93ffa7f05f217bc04..20299c20d28abcdbc229751d1d67d8f9b5111455 100644 (file)
@@ -3085,7 +3085,8 @@ t when called interactively."
    (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)