Skip to content

Commit

Permalink
safer recall_precompile_state (JuliaLang#2426)
Browse files Browse the repository at this point in the history
  • Loading branch information
IanButterworth authored Mar 7, 2021
1 parent 7a9d965 commit 8ca403b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/API.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1328,14 +1328,14 @@ function recall_precompile_state()
for (prefix, store) in (("suspend_cache_", pkgs_precompile_suspended), ("pending_cache_", pkgs_precompile_pending))
fpath = joinpath(Operations.pkg_scratchpath(), string(prefix, hash(string(Base.active_project(), Base.VERSION))))
if isfile(fpath)
v = open(fpath) do io
open(fpath) do io
try
deserialize(io)
pkgspecs = deserialize(io)
append!(empty!(store), pkgspecs)
catch
PackageSpec[]
empty!(store)
end
end
append!(empty!(store), v)
else
empty!(store)
end
Expand Down

0 comments on commit 8ca403b

Please sign in to comment.