Function: python-shell-with-environment

python-shell-with-environment is a macro defined in python.el.gz.

Signature

(python-shell-with-environment &rest BODY)

Documentation

Modify shell environment during execution of BODY.

Temporarily sets process-environment and exec-path(var)/exec-path(fun) during execution of body. If default-directory points to a remote machine then modifies tramp-remote-process-environment and python-shell-remote-exec-path instead.

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/python.el.gz
(defmacro python-shell-with-environment (&rest body)
  "Modify shell environment during execution of BODY.
Temporarily sets `process-environment' and `exec-path' during
execution of body.  If `default-directory' points to a remote
machine then modifies `tramp-remote-process-environment' and
`python-shell-remote-exec-path' instead."
  (declare (indent 0) (debug (body)))
  `(python-shell--with-environment
    (python-shell--calculate-process-environment)
    (lambda () ,@body)))