Skip to content

Commit

Permalink
Sprinkled "io" everywhere and fixed test
Browse files Browse the repository at this point in the history
  • Loading branch information
BioTurboNick committed Apr 23, 2021
1 parent 39f8f36 commit 4cf580a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
14 changes: 7 additions & 7 deletions base/errorshow.jl
Original file line number Diff line number Diff line change
Expand Up @@ -589,13 +589,13 @@ function show_compact_backtrace(io::IO, trace::Vector; print_linebreaks::Bool)
# Find modules involved in intermediate frames and print them
modules = filter(!isnothing, unique(t[1] |> parentmodule for t @view trace[i:j]))
length(modules) > 0 || return
print(repeat(' ', ndigits_max + 2))
print(io, repeat(' ', ndigits_max + 2))
for m modules
modulecolor = get_modulecolor!(modulecolordict, m, modulecolorcycler)
printstyled(io, m, color = modulecolor)
print(" ")
print(io, " ")
end
println()
println(io)
end

# find all frames that aren't in Julia base, stdlib, or an added package
Expand All @@ -614,16 +614,16 @@ function show_compact_backtrace(io::IO, trace::Vector; print_linebreaks::Bool)

if is[1] > 0
print_omitted_modules(1, is[1])
println(repeat(' ', ndigits_max + 2) * "")
println(io, repeat(' ', ndigits_max + 2) * "")
end

lasti = first(is)
@views for i is
i == 0 && continue
if i > lasti + 1
println(repeat(' ', ndigits_max + 2) * "")
println(io, repeat(' ', ndigits_max + 2) * "")
print_omitted_modules(lasti + 1, i - 1)
println(repeat(' ', ndigits_max + 2) * "")
println(io, repeat(' ', ndigits_max + 2) * "")
end
print_stackframe(io, i, trace[i][1], trace[i][2], ndigits_max, modulecolordict, modulecolorcycler)
if i < num_frames
Expand All @@ -633,7 +633,7 @@ function show_compact_backtrace(io::IO, trace::Vector; print_linebreaks::Bool)
lasti = i
end
else
println()
println(io)
end

length(trace) > length(is) && print(io, "Use `err` to retrieve the full stack trace.")
Expand Down
2 changes: 1 addition & 1 deletion stdlib/REPL/test/repl.jl
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ fake_repl(options = REPL.Options(confirm_exit=false,hascolor=true)) do stdin_wri
@test occursin("shell> ", s) # check for the echo of the prompt
@test occursin("'", s) # check for the echo of the input
s = readuntil(stdout_read, "\n\n")
@test startswith(s, "\e[0mERROR: unterminated single quote\nStacktrace:\n [1] ") ||
@test startswith(s, "\e[0mERROR: unterminated single quote\nUse ") ||
startswith(s, "\e[0m\e[1m\e[91mERROR: \e[39m\e[22m\e[91munterminated single quote\e[39m\nStacktrace:\n [1] ")
write(stdin_write, "\b")
end
Expand Down

0 comments on commit 4cf580a

Please sign in to comment.