Skip to content

Commit

Permalink
fix ConsoleLogger with Core IO objects (#41035)
Browse files Browse the repository at this point in the history
Fixes #40954
  • Loading branch information
vtjnash authored Jun 1, 2021
1 parent 4a8572f commit 58ffe7e
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions base/coreio.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,23 @@ function repr end

struct DevNull <: IO end
const devnull = DevNull()
isreadable(::DevNull) = false
iswritable(::DevNull) = true
isopen(::DevNull) = true
read(::DevNull, ::Type{UInt8}) = throw(EOFError())
write(::DevNull, ::UInt8) = 1
unsafe_write(::DevNull, ::Ptr{UInt8}, n::UInt)::Int = n
close(::DevNull) = nothing
flush(::DevNull) = nothing
wait_readnb(::DevNull) = wait()
wait_close(::DevNull) = wait()
eof(::DevNull) = true

let CoreIO = Union{Core.CoreSTDOUT, Core.CoreSTDERR}
global write, unsafe_write
write(io::CoreIO, x::UInt8) = Core.write(io, x)
unsafe_write(io::CoreIO, x::Ptr{UInt8}, nb::UInt) = Core.unsafe_write(io, x, nb)
global write(io::CoreIO, x::UInt8) = Core.write(io, x)
global unsafe_write(io::CoreIO, x::Ptr{UInt8}, nb::UInt) = Core.unsafe_write(io, x, nb)

CoreIO = Union{CoreIO, DevNull}
global read(::CoreIO, ::Type{UInt8}) = throw(EOFError())
global isopen(::CoreIO) = true
global isreadable(::CoreIO) = false
global iswritable(::CoreIO) = true
global flush(::CoreIO) = nothing
global eof(::CoreIO) = true
global wait_readnb(::CoreIO, nb::Int) = nothing
end

stdin = devnull
Expand Down

2 comments on commit 58ffe7e

@nanosoldier
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Executing the daily package evaluation, I will reply here when finished:

@nanosoldier runtests(ALL, isdaily = true)

@nanosoldier
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your package evaluation job has completed - possible new issues were detected. A full report can be found here. cc @maleadt

Please sign in to comment.