Skip to content

Commit f5b6f3a

Browse files
committed
Only use venv, .venv, env or .env if it's a directory
Should solve https://github.com/mfussenegger/nvim-dap-python/issues/126 Maybe this is good enough - another option would be to double check the if the python path exists, but that would add some extra workload.
1 parent 091e4ae commit f5b6f3a

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lua/dap-python.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ local get_python_path = function()
102102
for _, folder in ipairs({"venv", ".venv", "env", ".env"}) do
103103
local path = root .. "/" .. folder
104104
local stat = uv.fs_stat(path)
105-
if stat then
105+
if stat and stat.type == "directory" then
106106
return python_exe(path)
107107
end
108108
end

0 commit comments

Comments
 (0)