diff --git a/test/virtualenvwrapper-test.el b/test/virtualenvwrapper-test.el index fc98565..ce5dcd4 100644 --- a/test/virtualenvwrapper-test.el +++ b/test/virtualenvwrapper-test.el @@ -50,6 +50,8 @@ (should (s-contains? venv-tmp-env (getenv "PATH"))) ;; we set VIRTUAL_ENV for jedi and whoever else needs it (should (s-contains? venv-tmp-env (getenv "VIRTUAL_ENV"))) + ;; VIRTUAL_ENV does not end with "/" + (should (not (s-ends-with? "/" (getenv "VIRTUAL_ENV")))) ;; we add our dir to exec-path (should (s-contains? venv-tmp-env (car exec-path)))) diff --git a/virtualenvwrapper.el b/virtualenvwrapper.el index 5fafb90..cf366a2 100644 --- a/virtualenvwrapper.el +++ b/virtualenvwrapper.el @@ -242,7 +242,7 @@ prompting the user with the string PROMPT" (setenv "PATH" path) ;; keep eshell path in sync (setq eshell-path-env path)) - (setenv "VIRTUAL_ENV" venv-current-dir) + (setenv "VIRTUAL_ENV" (s-chop-suffix "/" venv-current-dir)) (if venv-workon-cd (venv--switch-to-project-dir)) (venv--set-venv-gud-pdb-command-name) @@ -537,7 +537,7 @@ virtualenvwrapper.el." ad-do-it (venv-shell-init buffer-name) (setenv "PATH" (concat venv-current-dir venv-executables-dir path-separator (getenv "PATH"))) - (setenv "VIRTUAL_ENV" venv-current-dir))))) + (setenv "VIRTUAL_ENV" (s-chop-suffix "/" venv-current-dir)))))) (ad-activate 'shell))