Skip to content

Commit

Permalink
Add module to isdefined calls
Browse files Browse the repository at this point in the history
Fixes a depwarn on 0.7
  • Loading branch information
timholy committed Jun 19, 2017
1 parent 6e179a4 commit 238d34f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/loadsave.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion test/query.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 238d34f

Please sign in to comment.