diff options
| author | William Boman <william@redwill.se> | 2023-03-06 17:53:57 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-03-06 17:53:57 +0100 |
| commit | 3ee3174e30e33c9d58fa07b0a73a6e180474b59c (patch) | |
| tree | f290ba91c363b79ecf21d443a4372fff4cc3e320 | |
| parent | chore: autogenerate (#1072) (diff) | |
| download | mason-3ee3174e30e33c9d58fa07b0a73a6e180474b59c.tar mason-3ee3174e30e33c9d58fa07b0a73a6e180474b59c.tar.gz mason-3ee3174e30e33c9d58fa07b0a73a6e180474b59c.tar.bz2 mason-3ee3174e30e33c9d58fa07b0a73a6e180474b59c.tar.lz mason-3ee3174e30e33c9d58fa07b0a73a6e180474b59c.tar.xz mason-3ee3174e30e33c9d58fa07b0a73a6e180474b59c.tar.zst mason-3ee3174e30e33c9d58fa07b0a73a6e180474b59c.zip | |
fix: fix writing pyvenv module wrapper (#1073)
Closes #1071.
| -rw-r--r-- | lua/mason-core/installer/context.lua | 2 | ||||
| -rw-r--r-- | tests/helpers/lua/test_helpers.lua | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/lua/mason-core/installer/context.lua b/lua/mason-core/installer/context.lua index d5c5583b..8a1e3678 100644 --- a/lua/mason-core/installer/context.lua +++ b/lua/mason-core/installer/context.lua @@ -269,7 +269,7 @@ function InstallContext:write_pyvenv_exec_wrapper(new_executable_rel_path, modul local module_exists, module_err = pcall(function() local result = self.spawn.python { "-c", ("import %s"):format(module), with_paths = { pip3.venv_path(self.cwd:get()) } } - if self.spawn.strict_mode then + if not self.spawn.strict_mode then result:get_or_throw() end end) diff --git a/tests/helpers/lua/test_helpers.lua b/tests/helpers/lua/test_helpers.lua index 08a0e91b..f11765d5 100644 --- a/tests/helpers/lua/test_helpers.lua +++ b/tests/helpers/lua/test_helpers.lua @@ -43,7 +43,7 @@ end ---@param opts PackageInstallOpts? function InstallContextGenerator(handle, opts) local context = InstallContext.new(handle, opts or {}) - context.spawn = setmetatable({ strict_mode = false }, { + context.spawn = setmetatable({ strict_mode = true }, { __index = function(self, cmd) self[cmd] = spy.new(mockx.just_runs()) return self[cmd] |
