Skip to content

Commit

Permalink
Stop using eval to find module location (#853)
Browse files Browse the repository at this point in the history
I added an explicit accessor for this in
JuliaLang/julia#55963
so Revise doesn't have to rely on internals.
  • Loading branch information
Keno authored Oct 3, 2024
1 parent 0ed87d4 commit 78ec36e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/loading.jl
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,11 @@ function modulefiles(mod::Module)
filename = fixpath(filename)
return get(src_file_key, filename, filename)
end
parentfile = String(first(methods(getfield(mod, :eval))).file)
if isdefined(Base, :moduleloc)
parentfile = String(Base.moduleloc(mod).file)
else
parentfile = String(first(methods(getfield(mod, :eval))).file)
end
id = PkgId(mod)
if id.name == "Base" || Symbol(id.name) stdlib_names
parentfile = normpath(Base.find_source_file(parentfile))
Expand Down

0 comments on commit 78ec36e

Please sign in to comment.