Function: python-shell-get-process-or-error

python-shell-get-process-or-error is a byte-compiled function defined in python.el.gz.

Signature

(python-shell-get-process-or-error &optional INTERACTIVEP)

Documentation

Return inferior Python process for current buffer or signal error.

When argument INTERACTIVEP is non-nil, use user-error instead of error with a user-friendly message.

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/python.el.gz
(defun python-shell-get-process-or-error (&optional interactivep)
  "Return inferior Python process for current buffer or signal error.
When argument INTERACTIVEP is non-nil, use `user-error' instead
of `error' with a user-friendly message."
  (or (python-shell-get-process)
      (if interactivep
          (user-error
           "Start a Python process first with `M-x run-python' or `%s'"
           ;; Get the binding.
           (key-description
            (where-is-internal
             #'run-python overriding-local-map t)))
        (error "No inferior Python process running"))))