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.el21
1 files changed, 1 insertions, 20 deletions
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index b6981c9156c..9fa2b1aaf19 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -3816,16 +3816,6 @@ variable.
3816 (compilation-shell-minor-mode 1) 3816 (compilation-shell-minor-mode 1)
3817 (python-pdbtrack-setup-tracking)) 3817 (python-pdbtrack-setup-tracking))
3818 3818
3819(defvar-local python-shell--process-cache)
3820(defvar-local python-shell--process-cache-valid)
3821
3822(defun python-shell--invalidate-process-cache ()
3823 "Invalidate process cache."
3824 (dolist (buffer (buffer-list))
3825 (with-current-buffer buffer
3826 (setq python-shell--process-cache nil
3827 python-shell--process-cache-valid nil))))
3828
3829(defun python-shell-make-comint (cmd proc-name &optional show internal) 3819(defun python-shell-make-comint (cmd proc-name &optional show internal)
3830 "Create a Python shell comint buffer. 3820 "Create a Python shell comint buffer.
3831CMD is the Python command to be executed and PROC-NAME is the 3821CMD is the Python command to be executed and PROC-NAME is the
@@ -3842,7 +3832,6 @@ killed."
3842 (let* ((proc-buffer-name 3832 (let* ((proc-buffer-name
3843 (format (if (not internal) "*%s*" " *%s*") proc-name))) 3833 (format (if (not internal) "*%s*" " *%s*") proc-name)))
3844 (when (not (comint-check-proc proc-buffer-name)) 3834 (when (not (comint-check-proc proc-buffer-name))
3845 (python-shell--invalidate-process-cache)
3846 (let* ((cmdlist (split-string-and-unquote cmd)) 3835 (let* ((cmdlist (split-string-and-unquote cmd))
3847 (interpreter (car cmdlist)) 3836 (interpreter (car cmdlist))
3848 (args (cdr cmdlist)) 3837 (args (cdr cmdlist))
@@ -3966,15 +3955,7 @@ If current buffer is in `inferior-python-mode', return it."
3966 3955
3967(defun python-shell-get-process () 3956(defun python-shell-get-process ()
3968 "Return inferior Python process for current buffer." 3957 "Return inferior Python process for current buffer."
3969 (unless (and python-shell--process-cache-valid 3958 (get-buffer-process (python-shell-get-buffer)))
3970 (or (not python-shell--process-cache)
3971 (and (process-live-p python-shell--process-cache)
3972 (buffer-live-p
3973 (process-buffer python-shell--process-cache)))))
3974 (setq python-shell--process-cache
3975 (get-buffer-process (python-shell-get-buffer))
3976 python-shell--process-cache-valid t))
3977 python-shell--process-cache)
3978 3959
3979(defun python-shell-get-process-or-error (&optional interactivep) 3960(defun python-shell-get-process-or-error (&optional interactivep)
3980 "Return inferior Python process for current buffer or signal error. 3961 "Return inferior Python process for current buffer or signal error.