Skip to content

Commit

Permalink
avoid private unwrapcontext API call (#590)
Browse files Browse the repository at this point in the history
  • Loading branch information
vtjnash authored Jan 7, 2024
1 parent 50eea5f commit a102750
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/JET.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit a102750

Please sign in to comment.