diff options
author | Karl Berry <karl@freefriends.org> | 2022-12-30 21:54:46 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2022-12-30 21:54:46 +0000 |
commit | 3c2b5f7312ad17c7c18d201ebabec6e926aa9dce (patch) | |
tree | c10f0b733421457f4b20132f8e72abdd1501aac3 /Master/texmf-dist/tex/lualatex/pyluatex | |
parent | 132933452e4a26cf30e80f64e7bcab840090f764 (diff) |
pyluatex (30dec22)
git-svn-id: svn://tug.org/texlive/trunk@65408 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/lualatex/pyluatex')
-rw-r--r-- | Master/texmf-dist/tex/lualatex/pyluatex/pyluatex.lua | 7 | ||||
-rw-r--r-- | Master/texmf-dist/tex/lualatex/pyluatex/pyluatex.sty | 2 |
2 files changed, 5 insertions, 4 deletions
diff --git a/Master/texmf-dist/tex/lualatex/pyluatex/pyluatex.lua b/Master/texmf-dist/tex/lualatex/pyluatex/pyluatex.lua index 0580d25a539..2b53bd77136 100644 --- a/Master/texmf-dist/tex/lualatex/pyluatex/pyluatex.lua +++ b/Master/texmf-dist/tex/lualatex/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) diff --git a/Master/texmf-dist/tex/lualatex/pyluatex/pyluatex.sty b/Master/texmf-dist/tex/lualatex/pyluatex/pyluatex.sty index 6e287e51000..02ac9d5f6cf 100644 --- a/Master/texmf-dist/tex/lualatex/pyluatex/pyluatex.sty +++ b/Master/texmf-dist/tex/lualatex/pyluatex/pyluatex.sty @@ -9,7 +9,7 @@ %% version 2005/12/01 or later. \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{pyluatex}[2022/06/05 v0.5.0 Execute Python code on the fly] +\ProvidesPackage{pyluatex}[2022/12/30 v0.5.1 Execute Python code on the fly] \RequirePackage{expl3} \ExplSyntaxOn |