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.el7
1 files changed, 5 insertions, 2 deletions
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index 3cdfb43e35f..9f14bef5258 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -1065,7 +1065,8 @@ When argument ARG is non-nil sends the innermost defun."
1065(defun python-shell-send-file (file-name &optional process) 1065(defun python-shell-send-file (file-name &optional process)
1066 "Send FILE-NAME to inferior Python process." 1066 "Send FILE-NAME to inferior Python process."
1067 (interactive "fFile to send: ") 1067 (interactive "fFile to send: ")
1068 (let ((process (or process (python-shell-get-or-create-process)))) 1068 (let ((process (or process (python-shell-get-or-create-process)))
1069 (full-file-name (expand-file-name file-name)))
1069 (accept-process-output process) 1070 (accept-process-output process)
1070 (with-current-buffer (process-buffer process) 1071 (with-current-buffer (process-buffer process)
1071 (delete-region (save-excursion 1072 (delete-region (save-excursion
@@ -1074,7 +1075,9 @@ When argument ARG is non-nil sends the innermost defun."
1074 (line-end-position))) 1075 (line-end-position)))
1075 (comint-send-string 1076 (comint-send-string
1076 process 1077 process
1077 (format "execfile('%s')\n" (expand-file-name file-name))))) 1078 (format
1079 "with open('%s') as __pyfile: exec(compile(__pyfile.read(), '%s', 'exec'))\n\n"
1080 full-file-name full-file-name))))
1078 1081
1079(defun python-shell-switch-to-shell () 1082(defun python-shell-switch-to-shell ()
1080 "Switch to inferior Python process buffer." 1083 "Switch to inferior Python process buffer."