From 2a1a2e3eec5aa0b7cea876cd5a229f64277811fe Mon Sep 17 00:00:00 2001 From: William Boman Date: Mon, 29 Jan 2024 07:27:32 +0100 Subject: [PATCH] fix(pypi): fix variable shadowing --- lua/mason-core/installer/managers/pypi.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lua/mason-core/installer/managers/pypi.lua b/lua/mason-core/installer/managers/pypi.lua index bda8925e8..d596028e5 100644 --- a/lua/mason-core/installer/managers/pypi.lua +++ b/lua/mason-core/installer/managers/pypi.lua @@ -55,7 +55,9 @@ end local function create_venv() local stock_candidates = platform.is.win and { "python", "python3" } or { "python3", "python" } local stock_target = resolve_python3(stock_candidates) - local _ = stock_target and log.fmt_debug("Resolved stock python3 installation version %s", stock_target.version) + if stock_target then + log.fmt_debug("Resolved stock python3 installation version %s", stock_target.version) + end local versioned_candidates = get_versioned_candidates(stock_target and stock_target.version) log.debug("Resolving versioned python3 candidates", versioned_candidates) local target = resolve_python3(versioned_candidates) or stock_target