Skip to content

Commit

Permalink
replace broken replaceuserpath function with existing contractuser one (
Browse files Browse the repository at this point in the history
#40274)

Fixes #39674
  • Loading branch information
vtjnash authored Apr 2, 2021
1 parent 754aada commit d07b5a1
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions base/errorshow.jl
Original file line number Diff line number Diff line change
Expand Up @@ -552,13 +552,6 @@ end
# replace `sf` as needed.
const update_stackframes_callback = Ref{Function}(identity)

function replaceuserpath(str)
str = replace(str, homedir() => "~")
# seems to be necessary for some paths with small letter drive c:// etc
str = replace(str, lowercasefirst(homedir()) => "~")
return str
end

const STACKTRACE_MODULECOLORS = [:magenta, :cyan, :green, :yellow]
const STACKTRACE_FIXEDCOLORS = IdDict(Base => :light_black, Core => :light_black)

Expand Down Expand Up @@ -698,7 +691,7 @@ end
function print_stackframe(io, i, frame::StackFrame, n::Int, digit_align_width, modulecolor)
file, line = string(frame.file), frame.line
stacktrace_expand_basepaths() && (file = something(find_source_file(file), file))
stacktrace_contract_userdir() && (file = replaceuserpath(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

0 comments on commit d07b5a1

Please sign in to comment.