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. (compilation-shell-minor-mode 1) (python-pdbtrack-setup-tracking)) -(defvar-local python-shell--process-cache) -(defvar-local python-shell--process-cache-valid) - -(defun python-shell--invalidate-process-cache () - "Invalidate process cache." - (dolist (buffer (buffer-list)) - (with-current-buffer buffer - (setq python-shell--process-cache nil - python-shell--process-cache-valid nil)))) - (defun python-shell-make-comint (cmd proc-name &optional show internal) "Create a Python shell comint buffer. CMD is the Python command to be executed and PROC-NAME is the @@ -3842,7 +3832,6 @@ killed." (let* ((proc-buffer-name (format (if (not internal) "*%s*" " *%s*") proc-name))) (when (not (comint-check-proc proc-buffer-name)) - (python-shell--invalidate-process-cache) (let* ((cmdlist (split-string-and-unquote cmd)) (interpreter (car cmdlist)) (args (cdr cmdlist)) @@ -3966,15 +3955,7 @@ If current buffer is in `inferior-python-mode', return it." (defun python-shell-get-process () "Return inferior Python process for current buffer." - (unless (and python-shell--process-cache-valid - (or (not python-shell--process-cache) - (and (process-live-p python-shell--process-cache) - (buffer-live-p - (process-buffer python-shell--process-cache))))) - (setq python-shell--process-cache - (get-buffer-process (python-shell-get-buffer)) - python-shell--process-cache-valid t)) - python-shell--process-cache) + (get-buffer-process (python-shell-get-buffer))) (defun python-shell-get-process-or-error (&optional interactivep) "Return inferior Python process for current buffer or signal error.