From dd6cd5a63cd6164419aa4d579f2932a7bd7c2f8e Mon Sep 17 00:00:00 2001 From: Tony Kelman Date: Sat, 22 Nov 2014 11:17:04 -0800 Subject: [PATCH] use tempdir instead of tempname in test/pkg.jl since tempname creates a file on windows, but the goal here is creating a directory. also don't try to delete nonexistent files during cleanup --- base/pkg/dir.jl | 2 +- test/pkg.jl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/base/pkg/dir.jl b/base/pkg/dir.jl index 9302184523bd8..be91b7bba06bf 100644 --- a/base/pkg/dir.jl +++ b/base/pkg/dir.jl @@ -48,7 +48,7 @@ function init(meta::String=DEFAULT_META, branch::String=META_BRANCH) run(`touch REQUIRE`) end catch e - rm(dir, recursive=true) + ispath(dir) && rm(dir, recursive=true) rethrow(e) end end diff --git a/test/pkg.jl b/test/pkg.jl index a329d8b7d68d3..e9f22dfacf899 100644 --- a/test/pkg.jl +++ b/test/pkg.jl @@ -1,6 +1,6 @@ function temp_pkg_dir(fn::Function) # Used in tests below to setup and teardown a sandboxed package directory - const tmpdir = ENV["JULIA_PKGDIR"] = tempname() + const tmpdir = ENV["JULIA_PKGDIR"] = joinpath(tempdir(),randstring()) @test !isdir(Pkg.dir()) try Pkg.init()