Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions dap-python.el
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,15 @@ you are debugging."
(defun dap-python--pyenv-executable-find (command)
"Find executable COMMAND, taking pyenv shims into account.
If the executable is a system executable and not in the same path
as the pyenv version then also return nil. This works around
https://github.com/pyenv/pyenv-which-ext."
(if (executable-find "pyenv")
as the pyenv version then also return nil. This works around
https://github.com/pyenv/pyenv-which-ext.

If pyenv is not installed or if pyenv has no \"local\" version defined
for the cwd, then fallback to `(executable-find)`, which see."
(if (and
(executable-find "pyenv")
(not (string-match "no local" (shell-command-to-string "pyenv local")))
)
(progn
(let ((pyenv-string (shell-command-to-string (concat "pyenv which " command)))
(pyenv-version-names (split-string (string-trim (shell-command-to-string "pyenv version-name")) ":"))
Expand Down