Skip to content

Commit ffb3bc2

Browse files
committed
Respect environment variables in the proper environment check.
1 parent cd5232e commit ffb3bc2

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

pythonic.el

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,8 @@ process flag."
220220
(--if-let (process-get process 'pythonic)
221221
(and
222222
(equal (plist-get it :pythonpath) (pythonic-get-pythonpath))
223-
(equal (plist-get it :path) (pythonic-get-path)))
223+
(equal (plist-get it :path) (pythonic-get-path))
224+
(equal (plist-get it :environment) python-shell-process-environment))
224225
(error "Process %s wasn't started with `start-pythonic'"
225226
(process-name process))))
226227

test/pythonic-test.el

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -409,6 +409,13 @@ change since process was start."
409409
(python-shell-exec-path '("/home/test/bin")))
410410
(should-not (pythonic-proper-environment-p process))))
411411

412+
(ert-deftest test-pythonic-proper-environment-p-change-environment ()
413+
"`pythonic-proper-environment-p' is null if
414+
`python-shell-process-environment' was changed."
415+
(let* ((process (start-pythonic :process "out" :args '("-V")))
416+
(python-shell-process-environment '("TEST=t")))
417+
(should-not (pythonic-proper-environment-p process))))
418+
412419
;;; Activate/deactivate environment.
413420

414421
(ert-deftest test-pythonic-activate ()

0 commit comments

Comments
 (0)