Skip to content

Commit 7369d40

Browse files
vtjnashKristofferC
authored andcommitted
replace broken replaceuserpath function with existing contractuser one (#40274)
Fixes #39674 (cherry picked from commit d07b5a1)
1 parent eda7da9 commit 7369d40

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

base/errorshow.jl

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -555,13 +555,6 @@ end
555555
# replace `sf` as needed.
556556
const update_stackframes_callback = Ref{Function}(identity)
557557

558-
function replaceuserpath(str)
559-
str = replace(str, homedir() => "~")
560-
# seems to be necessary for some paths with small letter drive c:// etc
561-
str = replace(str, lowercasefirst(homedir()) => "~")
562-
return str
563-
end
564-
565558
const STACKTRACE_MODULECOLORS = [:magenta, :cyan, :green, :yellow]
566559
const STACKTRACE_FIXEDCOLORS = IdDict(Base => :light_black, Core => :light_black)
567560

@@ -701,7 +694,7 @@ end
701694
function print_stackframe(io, i, frame::StackFrame, n::Int, digit_align_width, modulecolor)
702695
file, line = string(frame.file), frame.line
703696
stacktrace_expand_basepaths() && (file = something(find_source_file(file), file))
704-
stacktrace_contract_userdir() && (file = replaceuserpath(file))
697+
stacktrace_contract_userdir() && (file = contractuser(file))
705698

706699
# Used by the REPL to make it possible to open
707700
# the location of a stackframe/method in the editor.

0 commit comments

Comments
 (0)