Skip to content

Commit 0bcdb51

Browse files
committed
Detect if PYTHONPATH has proper value for process.
1 parent 2899a35 commit 0bcdb51

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

pythonic.el

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,8 +217,8 @@ process flag."
217217

218218
(defun pythonic-proper-environment-p (process)
219219
"Determine if python environment has been changed since PROCESS was started."
220-
(if (process-get process 'pythonic)
221-
t
220+
(--if-let (process-get process 'pythonic)
221+
(equal (plist-get it :pythonpath) (pythonic-get-pythonpath))
222222
(error "Process %s wasn't started with `start-pythonic'"
223223
(process-name process))))
224224

test/pythonic-test.el

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -397,6 +397,12 @@ change since process was start."
397397
(let ((process (start-pythonic :process "out" :args '("-V"))))
398398
(should (pythonic-proper-environment-p process))))
399399

400+
(ert-deftest test-pythonic-proper-environment-p-change-pythonpath ()
401+
"`pythonic-proper-environment-p' is null if PYTHONPATH was changed."
402+
(let* ((process (start-pythonic :process "out" :args '("-V")))
403+
(python-shell-extra-pythonpaths '("/home/test/modules")))
404+
(should-not (pythonic-proper-environment-p process))))
405+
400406
;;; Activate/deactivate environment.
401407

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

0 commit comments

Comments
 (0)