From 238d34f70db32430a47c5cc064a77bf58619e4e8 Mon Sep 17 00:00:00 2001 From: Tim Holy Date: Mon, 19 Jun 2017 04:04:19 -0500 Subject: [PATCH] Add module to `isdefined` calls Fixes a depwarn on 0.7 --- src/loadsave.jl | 2 +- test/query.jl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/loadsave.jl b/src/loadsave.jl index 370df413..2e92e166 100644 --- a/src/loadsave.jl +++ b/src/loadsave.jl @@ -2,7 +2,7 @@ const sym2loader = Dict{Symbol,Vector{Symbol}}() const sym2saver = Dict{Symbol,Vector{Symbol}}() function is_installed(pkg::Symbol) - isdefined(pkg) && isa(getfield(Main, pkg), Module) && return true # is a module defined in Main scope + isdefined(Main, pkg) && isa(getfield(Main, pkg), Module) && return true # is a module defined in Main scope path = Base.find_in_path(string(pkg)) # hacky way to determine if a Package is installed path == nothing && return false return isfile(path) diff --git a/test/query.jl b/test/query.jl index 316262c3..848eec06 100644 --- a/test/query.jl +++ b/test/query.jl @@ -251,7 +251,7 @@ try a = read(io, Int) @test a == 42 #make sure that LoadTest2 is used for saving, even though its at position 2 end - @test isdefined(:LoadTest1) # first module should load first but fail + @test isdefined(Main, :LoadTest1) # first module should load first but fail @test x == 42 rm(fn) end