aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/progmodes/python.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/progmodes/python.el')
-rw-r--r--lisp/progmodes/python.el16
1 files changed, 13 insertions, 3 deletions
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index 601850ed0fb..ffc6c1ac885 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -1824,7 +1824,11 @@ When MSG is non-nil messages the first line of STRING."
1824 (lines (split-string string "\n" t))) 1824 (lines (split-string string "\n" t)))
1825 (and msg (message "Sent: %s..." (nth 0 lines))) 1825 (and msg (message "Sent: %s..." (nth 0 lines)))
1826 (if (> (length lines) 1) 1826 (if (> (length lines) 1)
1827 (let* ((temp-file-name (make-temp-file "py")) 1827 (let* ((temporary-file-directory
1828 (if (file-remote-p default-directory)
1829 (concat (file-remote-p default-directory) "/tmp")
1830 temporary-file-directory))
1831 (temp-file-name (make-temp-file "py"))
1828 (file-name (or (buffer-file-name) temp-file-name))) 1832 (file-name (or (buffer-file-name) temp-file-name)))
1829 (with-temp-file temp-file-name 1833 (with-temp-file temp-file-name
1830 (insert string) 1834 (insert string)
@@ -1931,8 +1935,14 @@ FILE-NAME."
1931 (interactive "fFile to send: ") 1935 (interactive "fFile to send: ")
1932 (let* ((process (or process (python-shell-get-or-create-process))) 1936 (let* ((process (or process (python-shell-get-or-create-process)))
1933 (temp-file-name (when temp-file-name 1937 (temp-file-name (when temp-file-name
1934 (expand-file-name temp-file-name))) 1938 (expand-file-name
1935 (file-name (or (expand-file-name file-name) temp-file-name))) 1939 (or (file-remote-p temp-file-name 'localname)
1940 temp-file-name))))
1941 (file-name (or (when file-name
1942 (expand-file-name
1943 (or (file-remote-p file-name 'localname)
1944 file-name)))
1945 temp-file-name)))
1936 (when (not file-name) 1946 (when (not file-name)
1937 (error "If FILE-NAME is nil then TEMP-FILE-NAME must be non-nil")) 1947 (error "If FILE-NAME is nil then TEMP-FILE-NAME must be non-nil"))
1938 (python-shell-send-string 1948 (python-shell-send-string