Skip to content

Commit

Permalink
hack to avoid perm error when rm:ing temp dir on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
StefanKarpinski committed Apr 22, 2018
1 parent 114c1b6 commit f75d54c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion stdlib/Pkg/test/pkg.jl
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,10 @@ function temp_pkg_dir(fn::Function, tmp_dir=joinpath(tempdir(), randstring()),
end
fn()
finally
remove_tmp_dir && rm(tmp_dir, recursive=true)
if remove_tmp_dir
Sys.iswindows() && gc() # to make sure handles are closed on Windows
rm(tmp_dir, recursive=true)
end
end
end
end
Expand Down

0 comments on commit f75d54c

Please sign in to comment.