diff options
author | Norbert Preining <norbert@preining.info> | 2022-12-31 03:04:33 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2022-12-31 03:04:33 +0000 |
commit | 276038a22b002640c158178010b146bf9287b31b (patch) | |
tree | 0b9ace4bd052e023f56ef77d2eeb24c4a5442ade /macros/luatex/latex/pyluatex/pyluatex.lua | |
parent | 844019377157163b461e0fd4a66592e61963a530 (diff) |
CTAN sync 202212310304
Diffstat (limited to 'macros/luatex/latex/pyluatex/pyluatex.lua')
-rw-r--r-- | macros/luatex/latex/pyluatex/pyluatex.lua | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/macros/luatex/latex/pyluatex/pyluatex.lua b/macros/luatex/latex/pyluatex/pyluatex.lua index 0580d25a53..2b53bd7713 100644 --- a/macros/luatex/latex/pyluatex/pyluatex.lua +++ b/macros/luatex/latex/pyluatex/pyluatex.lua @@ -41,6 +41,7 @@ local env_end = nil local env_lines = nil local parent_env = nil local env_repl_mode = false +local env_success = true local last_code = nil local last_output = nil @@ -183,7 +184,7 @@ function pyluatex.execute(code, auto_print, write, repl_mode, store) end function pyluatex.print_env() - if last_output ~= nil then + if last_output ~= nil and (env_success or pyluatex.ignore_errors) then tex.print(last_output) end end @@ -198,8 +199,8 @@ local function record_line(line) table.insert(env_lines, code_in_line) end local code = table.concat(env_lines, "\n") - local success = pyluatex.execute(code, false, false, env_repl_mode, true) - if success or pyluatex.ignore_errors then + env_success = pyluatex.execute(code, false, false, env_repl_mode, true) + if env_success or pyluatex.ignore_errors then return line:sub(s) else return env_end .. err_cmd("Python error (see above)") .. line:sub(e + 1) |