Skip to content

Commit b04a468

Browse files
committed
Fix bug with broken python executable fallback
1 parent ccff6ac commit b04a468

2 files changed

Lines changed: 5 additions & 14 deletions

File tree

lua/pyrepl/core.lua

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -214,11 +214,7 @@ function M.hide_repl()
214214
end
215215
end
216216

217-
---Close session completely:
218-
---1) Close window;
219-
---2) Terminate console process;
220-
---3) Delete terminal buffer;
221-
---4) Move state to nil.
217+
---Close session completely.
222218
function M.close_repl()
223219
if not state or state.closing then
224220
return

lua/pyrepl/python.lua

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,23 @@ local M = {}
22

33
local config = require("pyrepl.config")
44
local packages = { "jupyter-console", "pynvim", "cairosvg", "pillow" }
5-
local tools = {
6-
uv = "uv pip install -p %s",
7-
pip = "%s -m pip install",
8-
}
5+
local tools = { uv = "uv pip install -p %s", pip = "%s -m pip install" }
96
local python_path_cache
107
local console_path_cache
118
local console_completions_cache
129
local console_completions_running
1310

1411
---Resolve Python path from the following candidates:
15-
---1) config.python_path;
16-
---2) vim.g.python3_host_prog;
17-
---3) "python3".
12+
---config.python_path -> vim.g.python3_host_prog -> "python3"
1813
---@return string
1914
function M.get_python_path()
2015
if python_path_cache then
2116
return python_path_cache
2217
end
2318

2419
local candidates = {
25-
config.get_state().python_path,
26-
vim.g.python3_host_prog,
20+
config.get_state().python_path or "",
21+
vim.g.python3_host_prog or "",
2722
"python3",
2823
}
2924

0 commit comments

Comments
 (0)