From 8ca403be94187f942aca70f954900c6d139df944 Mon Sep 17 00:00:00 2001 From: Ian Butterworth Date: Sun, 7 Mar 2021 09:30:43 -0500 Subject: [PATCH] safer recall_precompile_state (#2426) --- src/API.jl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/API.jl b/src/API.jl index a83f8356fe..12bea14aa1 100644 --- a/src/API.jl +++ b/src/API.jl @@ -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