Skip to content

Commit

Permalink
Stop using eval to find module location
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 committed Oct 3, 2024
1 parent 0ed87d4 commit 5e52d82
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)

Check warning on line 79 in src/loading.jl

View check run for this annotation

Codecov / codecov/patch

src/loading.jl#L79

Added line #L79 was not covered by tests
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 5e52d82

Please sign in to comment.