Skip to content

Commit

Permalink
Remove duplicate lines in print_stackframe (#49751)
Browse files Browse the repository at this point in the history
These lines were apparently refactored into `print_module_path_file` but
not removed from `print_stackframe`.

Also moved the `fixup_stdlib_path` call because `file` isn't even used
in the parent function.
  • Loading branch information
BioTurboNick authored Aug 14, 2023
1 parent 7157029 commit 09e8109
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions base/errorshow.jl
Original file line number Diff line number Diff line change
Expand Up @@ -716,9 +716,6 @@ parentmodule_before_main(x) = parentmodule_before_main(parentmodule(x))
# Print a stack frame where the module color is set manually with `modulecolor`.
function print_stackframe(io, i, frame::StackFrame, n::Int, ndigits_max, modulecolor)
file, line = string(frame.file), frame.line
file = fixup_stdlib_path(file)
stacktrace_expand_basepaths() && (file = something(find_source_file(file), file))
stacktrace_contract_userdir() && (file = contractuser(file))

# Used by the REPL to make it possible to open
# the location of a stackframe/method in the editor.
Expand Down Expand Up @@ -758,6 +755,7 @@ function print_module_path_file(io, modul, file, line; modulecolor = :light_blac
end

# filepath
file = fixup_stdlib_path(file)
stacktrace_expand_basepaths() && (file = something(find_source_file(file), file))
stacktrace_contract_userdir() && (file = contractuser(file))
print(io, " ")
Expand Down

0 comments on commit 09e8109

Please sign in to comment.