From a102750e0fbe812ca55e3d807fd3b7bc37735d06 Mon Sep 17 00:00:00 2001 From: Jameson Nash Date: Sat, 6 Jan 2024 21:00:46 -0500 Subject: [PATCH] avoid private unwrapcontext API call (#590) --- src/JET.jl | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/JET.jl b/src/JET.jl index 66d13e321..bd96022d2 100644 --- a/src/JET.jl +++ b/src/JET.jl @@ -1159,11 +1159,8 @@ function Base.show(io::IO, t::JETTestFailure) printstyled(io, something(t.source.file, :none), ":", t.source.line, "\n"; bold=true, color=:default) println(io, TEST_INDENTS, "Expression: ", t.orig_expr) # print abstract call stack, with appropriate indents - _, ctx = Base.unwrapcontext(io) - buf = IOBuffer() - ioctx = IOContext(buf, ctx) - show(ioctx, t.result) - lines = replace(String(take!(buf)), '\n'=>string('\n',TEST_INDENTS)) + result = repr(t.result, context=io) + lines = replace(result, '\n'=>string('\n', TEST_INDENTS)) print(io, TEST_INDENTS, lines) end