diff --git a/src/model/io/redirect.lua b/src/model/io/redirect.lua index e60bf94f..257bb5fd 100644 --- a/src/model/io/redirect.lua +++ b/src/model/io/redirect.lua @@ -13,7 +13,9 @@ local function set_print(M) if i ~= l then out = out .. '\t' end end origPrint(out) - M.output:push(out) + -- origPrint above has already emitted the output + -- (and the error, if there was any) + local _ = pcall(M.output.push, M.output, out) end _G.print = magicPrint end