Skip to content

Commit d1b8eba

Browse files
committed
Fix depwarn and error on 0.6
1 parent c20c25f commit d1b8eba

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

src/loadsave.jl

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,13 +58,15 @@ save(s::@compat(Union{AbstractString,IO}), data...; options...) =
5858
function save{sym}(df::Type{DataFormat{sym}}, f::AbstractString, data...; options...)
5959
libraries = applicable_savers(df)
6060
checked_import(libraries[1])
61-
save(File(DataFormat{sym}, f), data...; options...)
61+
eval(Main, :($save($File($(DataFormat{sym}), $f),
62+
$data...; $options...)))
6263
end
6364

6465
function save{sym}(df::Type{DataFormat{sym}}, s::IO, data...; options...)
6566
libraries = applicable_savers(df)
6667
checked_import(libraries[1])
67-
save(Stream(DataFormat{sym}, s), data...; options...)
68+
eval(Main, :($save($Stream($(DataFormat{sym}), $s),
69+
$data...; $options...)))
6870
end
6971

7072

@@ -82,7 +84,7 @@ function load{F}(q::Formatted{F}, args...; options...)
8284
if !has_method_from(methods(Library.load), Library)
8385
throw(LoaderError(string(library), "load not defined"))
8486
end
85-
return Library.load(q, args...; options...)
87+
return eval(Main, :($(Library.load)($q, $args...; $options...)))
8688
catch e
8789
push!(failures, (e, q))
8890
end
@@ -99,7 +101,7 @@ function save{F}(q::Formatted{F}, data...; options...)
99101
if !has_method_from(methods(Library.save), Library)
100102
throw(WriterError(string(library), "save not defined"))
101103
end
102-
return Library.save(q, data...; options...)
104+
return eval(Main, :($(Library.save)($q, $data...; $options...)))
103105
catch e
104106
push!(failures, (e, q))
105107
end

test/query.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ else
66
const Test = BaseTestNext
77
end
88
using Compat
9+
import Compat.String
910

1011
if VERSION < v"0.4.0-dev"
1112
import FileIO.Pair
@@ -134,7 +135,7 @@ try
134135
@test isnull(file_extension(q))
135136

136137
# File with correct extension
137-
str = takebuf_string(io)
138+
str = String(take!(io))
138139
fn = string(tempname(), ".jnk")
139140
open(fn, "w") do file
140141
write(file, str)

0 commit comments

Comments
 (0)