Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/JETBase.jl
Original file line number Diff line number Diff line change
Expand Up @@ -893,18 +893,18 @@ function analyze_and_report_package!(interp::ConcreteInterpreter,
end

function find_pkg(pkgname::AbstractString)
pkgenv = Base.identify_package_env(pkgname)
pkgenv = @lock Base.require_lock Base.identify_package_env(pkgname)
isnothing(pkgenv) && error(lazy"Unknown package $pkgname.")
pkgid, env = pkgenv
filename = Base.locate_package(pkgid, env)
filename = @lock Base.require_lock Base.locate_package(pkgid, env)
isnothing(filename) && error(lazy"Expected $pkgname to have a source file.")
return (; pkgid, filename)
end

function find_pkg(pkgmod::Module)
filename = pathof(pkgmod)
isnothing(filename) && error(lazy"Cannot analyze a module defined in the REPL.")
pkgid = Base.identify_package(String(nameof(pkgmod)))
pkgid = @lock Base.require_lock Base.identify_package(String(nameof(pkgmod)))
isnothing(pkgid) && error(lazy"Expected $pkgmod to exist as a package.")
return (; pkgid, filename)
end
Expand Down
Loading