diff --git a/README.md b/README.md index 495a4f2bd..af5acccf4 100644 --- a/README.md +++ b/README.md @@ -122,8 +122,6 @@ Currently, the `@compat` macro supports the following syntaxes: * [`normalize`](http://docs.julialang.org/en/latest/stdlib/linalg/?highlight=normalize#Base.normalize) and [`normalize!`](http://docs.julialang.org/en/latest/stdlib/linalg/?highlight=normalize#Base.normalize!), normalizes a vector with respect to the p-norm ([#13681]) -* `redirect_stdout`, `redirect_stderr`, and `redirect_stdin` take an optional function as a first argument, `redirect_std*(f, stream)`, so that one may use `do` block syntax (as first available for Julia 0.6) - * `unsafe_get` returns the `:value` field of a `Nullable` object without any null-check and has a generic fallback for non-`Nullable` argument ([#18484]) * `isnull` has a generic fallback for non-`Nullable` argument diff --git a/src/Compat.jl b/src/Compat.jl index e8395ba05..9b47ca76d 100644 --- a/src/Compat.jl +++ b/src/Compat.jl @@ -87,17 +87,6 @@ end eval(mod, :(include_string($code, $fname))) end -import Base: redirect_stdin, redirect_stdout, redirect_stderr -if VERSION < v"0.6.0-dev.374" - for (F,S) in ((:redirect_stdin, :STDIN), (:redirect_stdout, :STDOUT), (:redirect_stderr, :STDERR)) - @eval function $F(f::Function, stream) - STDOLD = $S - $F(stream) - try f() finally $F(STDOLD) end - end - end -end - @static if VERSION < v"0.6.0-dev.528" macro __DIR__() Base.source_dir() diff --git a/test/runtests.jl b/test/runtests.jl index 947102e0b..8691c3c9b 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -21,34 +21,6 @@ for os in [:apple, :bsd, :linux, :unix, :windows] @eval @test Compat.Sys.$(Symbol("is", os))() == $from_base() end -# do-block redirect_std* -# 0.6 -let filename = tempname() - ret = open(filename, "w") do f - redirect_stdout(f) do - println("hello") - [1,3] - end - end - @test ret == [1,3] - @test chomp(read(filename, String)) == "hello" - ret = open(filename, "w") do f - redirect_stderr(f) do - println(stderr, "WARNING: hello") - [2] - end - end - @test ret == [2] - @test occursin("WARNING: hello", read(filename, String)) - ret = open(filename) do f - redirect_stdin(f) do - readline() - end - end - @test occursin("WARNING: hello", ret) - rm(filename) -end - # 0.6 @test @__DIR__() == dirname(@__FILE__)