Merge pull request #4851 from daanturo/pyenv-fails-friendly

Active pyenv-mode only when pyenv exe is found
This commit is contained in:
Henrik Lissner 2021-04-14 12:46:43 -04:00 committed by GitHub
commit 82dfa22e77
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -243,8 +243,8 @@
:when (featurep! +pyenv) :when (featurep! +pyenv)
:after python :after python
:config :config
(pyenv-mode +1)
(when (executable-find "pyenv") (when (executable-find "pyenv")
(pyenv-mode +1)
(add-to-list 'exec-path (expand-file-name "shims" (or (getenv "PYENV_ROOT") "~/.pyenv")))) (add-to-list 'exec-path (expand-file-name "shims" (or (getenv "PYENV_ROOT") "~/.pyenv"))))
(add-hook 'python-mode-local-vars-hook #'+python-pyenv-mode-set-auto-h) (add-hook 'python-mode-local-vars-hook #'+python-pyenv-mode-set-auto-h)
(add-hook 'doom-switch-buffer-hook #'+python-pyenv-mode-set-auto-h)) (add-hook 'doom-switch-buffer-hook #'+python-pyenv-mode-set-auto-h))