Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Drop compat code for devnull, stdin, stdout, and stderr from #…
Browse files Browse the repository at this point in the history
martinholters committed Sep 29, 2019

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent 41a99ab commit 2543a7f
Showing 4 changed files with 10 additions and 36 deletions.
3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -336,9 +336,6 @@ Currently, the `@compat` macro supports the following syntaxes:

* `object_id` is now `objectid` ([#25615]).

* `DevNull`, `STDIN`, `STDOUT` and `STDERR` are now `devnull`, `stdin`, `stdout` and
`stderr` respectively ([#25959]).

* `LinSpace` is now `LinRange` ([#25896]).

* `isupper`, `islower`, `ucfirst` and `lcfirst` are now `isuppercase`, `islowercase`,
25 changes: 0 additions & 25 deletions src/Compat.jl
Original file line number Diff line number Diff line change
@@ -7,31 +7,6 @@ import Sockets

include("compatmacro.jl")

@static if !isdefined(Base, :devnull) #25959
export devnull, stdout, stdin, stderr
const devnull = DevNull
for f in (:stdout, :stdin, :stderr)
F = Symbol(uppercase(string(f)))
rf = Symbol(string("_redirect_", f))
@eval begin
$f = $F
# overload internal _redirect_std* functions
# so that they change Compat.std*
function Base.$rf(stream::IO)
ret = invoke(Base.$rf, Tuple{Any}, stream)
global $f = $F
return ret
end
end
end
# in __init__ because these can't be saved during precompiling
function __init__()
global stdout = STDOUT
global stdin = STDIN
global stderr = STDERR
end
end

@static if !isdefined(Base, Symbol("@nospecialize"))
# 0.7
macro nospecialize(arg)
10 changes: 10 additions & 0 deletions test/old.jl
Original file line number Diff line number Diff line change
@@ -13,3 +13,13 @@ module TestSockets

@test ip"127.0.0.1".host == UInt32(2130706433)
end

# tests of removed functionality (i.e. justs tests Base)

# 25959
@test all(x -> isa(x, IO), (devnull, stdin, stdout, stderr))
@static if !isdefined(Base, :devnull)
@test stdin === STDIN
@test stdout === STDOUT
@test stderr === STDERR
end
8 changes: 0 additions & 8 deletions test/runtests.jl
Original file line number Diff line number Diff line change
@@ -905,14 +905,6 @@ import Compat.Markdown
@test repr("text/plain", "string") == "\"string\"" #25990
@test showable("text/plain", 3.14159) #26089

# 25959
@test all(x -> isa(x, IO), (devnull, stdin, stdout, stderr))
@static if !isdefined(Base, :devnull)
@test stdin === STDIN
@test stdout === STDOUT
@test stderr === STDERR
end

# 0.7.0-DEV.3526
module TestNames
export foo

0 comments on commit 2543a7f

Please sign in to comment.