Skip to content

Commit

Permalink
need to set stdout etc in __init__
Browse files Browse the repository at this point in the history
  • Loading branch information
stevengj committed Feb 24, 2018
1 parent 7434380 commit e39939a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Compat.jl
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ include("compatmacro.jl")
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"))
Expand Down
5 changes: 5 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1418,6 +1418,11 @@ import Compat.Markdown

# 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
Expand Down

0 comments on commit e39939a

Please sign in to comment.