diff --git a/Project.toml b/Project.toml index 5a936b2..3fcfd0e 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "ArgTools" uuid = "0dad84c5-d112-42e6-8d28-ef12dabb789f" authors = ["Stefan Karpinski and contributors"] -version = "1.1.1" +version = "1.1.2" [compat] julia = "1.3" diff --git a/test/runtests.jl b/test/runtests.jl index 5d931c1..57705ec 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -83,15 +83,36 @@ import Base.Filesystem: TEMP_CLEANUP @test_throws ErrorException send_data(ErrIO(), dst) @test !isfile(dst) end - @testset "arg_write(nothing)" begin - SAVE_TEMP_CLEANUP = copy(TEMP_CLEANUP) - empty!(TEMP_CLEANUP) - try - @test_throws ErrorException send_data(ErrIO()) - @test length(TEMP_CLEANUP) == 1 - @test !ispath(first(keys(TEMP_CLEANUP))) - finally - merge!(TEMP_CLEANUP, SAVE_TEMP_CLEANUP) + # post-https://github.com/JuliaLang/julia/pull/52898 we need to acquire + # the lock and unpack `TEMP_CLEANUP` to use it. + if isdefined(Base, :Lockable) && TEMP_CLEANUP isa Base.Lockable + @testset "arg_write(nothing)" begin + local SAVE_TEMP_CLEANUP + @lock TEMP_CLEANUP begin + SAVE_TEMP_CLEANUP = copy(TEMP_CLEANUP[]) + empty!(TEMP_CLEANUP[]) + end + try + @test_throws ErrorException send_data(ErrIO()) + @lock TEMP_CLEANUP begin + @test length(TEMP_CLEANUP[]) == 1 + @test !ispath(first(keys(TEMP_CLEANUP[]))) + end + finally + @lock TEMP_CLEANUP merge!(TEMP_CLEANUP[], SAVE_TEMP_CLEANUP) + end + end + else + @testset "arg_write(nothing)" begin + SAVE_TEMP_CLEANUP = copy(TEMP_CLEANUP) + empty!(TEMP_CLEANUP) + try + @test_throws ErrorException send_data(ErrIO()) + @test length(TEMP_CLEANUP) == 1 + @test !ispath(first(keys(TEMP_CLEANUP))) + finally + merge!(TEMP_CLEANUP, SAVE_TEMP_CLEANUP) + end end end end