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
11 changes: 6 additions & 5 deletions lua/dap-python.lua
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,12 @@ end

---@return string|nil
local get_python_path = function()

if M.resolve_python then
assert(type(M.resolve_python) == "function", "resolve_python must be a function")
return M.resolve_python()
end

local venv_path = os.getenv('VIRTUAL_ENV')
if venv_path then
return python_exe(venv_path)
Expand All @@ -105,11 +111,6 @@ local get_python_path = function()
return venv_path .. '/bin/python'
end

if M.resolve_python then
assert(type(M.resolve_python) == "function", "resolve_python must be a function")
return M.resolve_python()
end

for root in roots() do
for _, folder in ipairs({"venv", ".venv", "env", ".env"}) do
local path = root .. "/" .. folder
Expand Down