Fix checking for python modules if python executable is missing

This commit is contained in:
2023-09-05 19:37:33 +02:00
committed by GitHub
parent 3d87f08761
commit 1c6d546a66
+4
View File
@@ -59,6 +59,10 @@ end
--- Asserts that a python module is installed --- Asserts that a python module is installed
---@param mod string: The python module to check ---@param mod string: The python module to check
function M.python3_module_is_installed(mod) function M.python3_module_is_installed(mod)
if not M.is_installed("python3") then
return false
end
local resp = vim.system({ "python3", "-m", "pip", "show", mod, }):wait() local resp = vim.system({ "python3", "-m", "pip", "show", mod, }):wait()
return resp.code == 0 return resp.code == 0
end end