From eddd2c884f341062cc75e839f675e16c93b80d1d Mon Sep 17 00:00:00 2001 From: Lilith Hafner Date: Tue, 3 Oct 2023 15:32:18 -0500 Subject: [PATCH] fixup --- test/python/pycall.jl | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/test/python/pycall.jl b/test/python/pycall.jl index 08f9bc611..5806f1c72 100644 --- a/test/python/pycall.jl +++ b/test/python/pycall.jl @@ -6,12 +6,18 @@ function with_pycall_in_default_environment(f) path = Pkg.project().path Pkg.activate() install = "PyCall" ∉ keys(Pkg.project().dependencies) - install && Pkg.add("PyCall") + if install + Pkg.add("PyCall") + end + Pkg.activate(path) try f() finally - install && Pkg.rm("PyCall") - Pkg.activate(path) + if install + Pkg.activate() + Pkg.rm("PyCall") + Pkg.activate(path) + end end end