Skip to content

Commit b3dcfb1

Browse files
authored
Merge pull request #145 from JuliaIO/yyc/0.7
Fix most of 0.7 depwarns
2 parents c43eacd + 396b512 commit b3dcfb1

File tree

5 files changed

+12
-16
lines changed

5 files changed

+12
-16
lines changed

REQUIRE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
julia 0.5
2-
Compat 0.17.0
2+
Compat 0.27.0

docs/make_docs.jl

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
using FileIO, Compat
2-
import Compat.String
1+
using FileIO
32
import FileIO: LOAD, SAVE, OSX, OS
43
const fs = open(Pkg.dir("FileIO", "docs", "registry.md"), "w")
54

@@ -44,7 +43,7 @@ function add_format{Sym}(::Type{DataFormat{Sym}}, magic, extension, io_libs...)
4443
end
4544

4645

47-
function add_format{sym}(fmt::Type{DataFormat{sym}}, magic::@compat(Union{Tuple,AbstractVector,String}), extension)
46+
function add_format{sym}(fmt::Type{DataFormat{sym}}, magic::Union{Tuple,AbstractVector,String}, extension)
4847
println(sym)
4948
end
5049

src/query.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ split_predicates(list) = filter(x-> x <: OS, list), filter(x-> !(x <: OS), list)
1212
applies_to_os(os::Vector) = isempty(os) || any(applies_to_os, os)
1313
applies_to_os{O <: OS}(os::Type{O}) = false
1414

15-
applies_to_os{U <: Unix}(os::Type{U}) = is_unix()
16-
applies_to_os(os::Type{Windows}) = is_windows()
17-
applies_to_os(os::Type{OSX}) = is_apple()
18-
applies_to_os(os::Type{Linux}) = is_linux()
15+
applies_to_os{U <: Unix}(os::Type{U}) = Compat.Sys.isunix()
16+
applies_to_os(os::Type{Windows}) = Compat.Sys.iswindows()
17+
applies_to_os(os::Type{OSX}) = Compat.Sys.isapple()
18+
applies_to_os(os::Type{Linux}) = Compat.Sys.islinux()
1919

2020
function add_loadsave(format, predicates)
2121
library = shift!(predicates)

test/loadsave.jl

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
using FileIO
22
using Base.Test
3-
using Compat
43

54
# Stub readers---these might bork any existing readers, so don't
65
# run these tests while doing other things!
@@ -60,7 +59,7 @@ add_format(format"DUMMY", b"DUMMY", ".dmy")
6059

6160
module Dummy
6261

63-
using FileIO, Compat
62+
using FileIO
6463

6564
function FileIO.load(file::File{format"DUMMY"})
6665
open(file) do s
@@ -166,7 +165,6 @@ del_format(format"DUMMY")
166165
# PPM/PBM can be either binary or text. Test that the defaults work,
167166
# and that we can force a choice.
168167
module AmbigExt
169-
using Compat
170168
import FileIO: File, @format_str, Stream, stream, skipmagic
171169

172170
load(f::File{format"AmbigExt1"}) = open(f) do io

test/query.jl

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,21 @@
11
using FileIO
22
using Base.Test
33
using Compat
4-
using Compat.String
54

65
@testset "OS" begin
7-
if is_linux()
6+
if Compat.Sys.islinux()
87
@test FileIO.applies_to_os(FileIO.Linux)
98
@test !(FileIO.applies_to_os(FileIO.OSX))
109
@test FileIO.applies_to_os(FileIO.Unix)
1110
@test !(FileIO.applies_to_os(FileIO.Windows))
1211
end
13-
if is_apple()
12+
if Compat.Sys.isapple()
1413
@test !(FileIO.applies_to_os(FileIO.Linux))
1514
@test FileIO.applies_to_os(FileIO.OSX)
1615
@test FileIO.applies_to_os(FileIO.Unix)
1716
@test !(FileIO.applies_to_os(FileIO.Windows))
1817
end
19-
if is_windows()
18+
if Compat.Sys.iswindows()
2019
@test !(FileIO.applies_to_os(FileIO.Linux))
2120
@test !(FileIO.applies_to_os(FileIO.OSX))
2221
@test !(FileIO.applies_to_os(FileIO.Unix))
@@ -231,7 +230,7 @@ try
231230
@testset "multiple libs" begin
232231
lensave0 = length(FileIO.sym2saver)
233232
lenload0 = length(FileIO.sym2loader)
234-
OSKey = is_apple() ? FileIO.OSX : is_windows() ? FileIO.Windows : is_linux() ? FileIO.Linux : error("os not supported")
233+
OSKey = Compat.Sys.isapple() ? FileIO.OSX : Compat.Sys.iswindows() ? FileIO.Windows : Compat.Sys.islinux() ? FileIO.Linux : error("os not supported")
235234
add_format(
236235
format"MultiLib",
237236
UInt8[0x42,0x4d],

0 commit comments

Comments
 (0)