diff options
Diffstat (limited to 'lisp/progmodes/python.el')
| -rw-r--r-- | lisp/progmodes/python.el | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index b7902fb9786..d4226e5ce7b 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el | |||
| @@ -2113,20 +2113,25 @@ remote host, the returned value is intended for | |||
| 2113 | (defun python-shell-calculate-exec-path () | 2113 | (defun python-shell-calculate-exec-path () |
| 2114 | "Calculate `exec-path'. | 2114 | "Calculate `exec-path'. |
| 2115 | Prepends `python-shell-exec-path' and adds the binary directory | 2115 | Prepends `python-shell-exec-path' and adds the binary directory |
| 2116 | for virtualenv if `python-shell-virtualenv-root' is set. If | 2116 | for virtualenv if `python-shell-virtualenv-root' is set - this |
| 2117 | `default-directory' points to a remote host, the returned value | 2117 | will use the python interpreter from inside the virtualenv when |
| 2118 | appends `python-shell-remote-exec-path' instead of `exec-path'." | 2118 | starting the shell. If `default-directory' points to a remote host, |
| 2119 | the returned value appends `python-shell-remote-exec-path' instead | ||
| 2120 | of `exec-path'." | ||
| 2119 | (let ((new-path (copy-sequence | 2121 | (let ((new-path (copy-sequence |
| 2120 | (if (file-remote-p default-directory) | 2122 | (if (file-remote-p default-directory) |
| 2121 | python-shell-remote-exec-path | 2123 | python-shell-remote-exec-path |
| 2122 | exec-path)))) | 2124 | exec-path))) |
| 2125 | |||
| 2126 | ;; Windows and POSIX systems use different venv directory structures | ||
| 2127 | (virtualenv-bin-dir (if (eq system-type 'windows-nt) "Scripts" "bin"))) | ||
| 2123 | (python-shell--add-to-path-with-priority | 2128 | (python-shell--add-to-path-with-priority |
| 2124 | new-path python-shell-exec-path) | 2129 | new-path python-shell-exec-path) |
| 2125 | (if (not python-shell-virtualenv-root) | 2130 | (if (not python-shell-virtualenv-root) |
| 2126 | new-path | 2131 | new-path |
| 2127 | (python-shell--add-to-path-with-priority | 2132 | (python-shell--add-to-path-with-priority |
| 2128 | new-path | 2133 | new-path |
| 2129 | (list (expand-file-name "bin" python-shell-virtualenv-root))) | 2134 | (list (expand-file-name virtualenv-bin-dir python-shell-virtualenv-root))) |
| 2130 | new-path))) | 2135 | new-path))) |
| 2131 | 2136 | ||
| 2132 | (defun python-shell-tramp-refresh-remote-path (vec paths) | 2137 | (defun python-shell-tramp-refresh-remote-path (vec paths) |