@@ -120,6 +120,12 @@ It will use `python-shell-exec-path' for PATH variable,
120120 (--remove (member it python-shell-extra-pythonpaths) it)
121121 (append python-shell-extra-pythonpaths it)))))))
122122
123+ (defun pythonic-get-path ()
124+ " Return appropriate PATH variable for pythonic process."
125+ (if (pythonic-remote-p)
126+ (pythonic-get-path-variable-tramp)
127+ (pythonic-get-path-variable)))
128+
123129(defun pythonic-get-path-variable ()
124130 " Get PATH variable according to `python-shell-exec-path' ."
125131 (s-join path-separator
@@ -129,14 +135,20 @@ It will use `python-shell-exec-path' for PATH variable,
129135 (-remove 's-blank? )
130136 (-distinct))))
131137
138+ (defun pythonic-get-path-variable-tramp ()
139+ " Get PATH variable on remote host according to `python-shell-exec-path' ."
140+ (let* ((vec (tramp-dissect-file-name (pythonic-tramp-connection)))
141+ (path (-distinct (append python-shell-exec-path (tramp-get-remote-path vec)))))
142+ (s-join path-separator path)))
143+
132144(defun pythonic-set-path-variable ()
133145 " Set PATH according to `python-shell-exec-path' ."
134146 (setenv " PATH" (pythonic-get-path-variable)))
135147
136148(defun pythonic-set-path-variable-tramp ()
137149 " Set PATH according to `python-shell-exec-path' on remote host."
138150 (let* ((vec (tramp-dissect-file-name (pythonic-tramp-connection)))
139- (path (append python-shell-exec- path (tramp -get-remote- path vec ))))
151+ (path (s-split path-separator (pythonic -get-path-variable-tramp ))))
140152 (tramp-set-connection-property vec " remote-path" path)
141153 (tramp-set-remote-path vec)))
142154
@@ -186,7 +198,7 @@ process flag."
186198 (set-process-query-on-exit-flag process query-on-exit)
187199 (process-put process 'default-directory default-directory)
188200 (process-put process 'environment python-shell-process-environment)
189- (process-put process 'path (pythonic-get-path-variable ))
201+ (process-put process 'path (pythonic-get-path))
190202 (process-put process 'pythonpath (pythonic-get-pythonpath-variable))
191203 process)))
192204
0 commit comments