Skip to content

Commit

Permalink
Do not capture interrupts with iocapture() (#1453)
Browse files Browse the repository at this point in the history
  • Loading branch information
mortenpi authored Oct 25, 2020
1 parent c56bcb8 commit aea49fd
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/DocTests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ function eval_repl(block, sandbox, meta::Dict, doc::Documents.Document, page)
# see https://github.com/JuliaLang/julia/pull/33864
ex = REPL.softscope!(ex)
end
c = IOCapture.iocapture(throwerrors=false) do
c = IOCapture.iocapture(throwerrors = :interrupt) do
Core.eval(sandbox, ex)
end
Core.eval(sandbox, Expr(:global, Expr(:(=), :ans, QuoteNode(c.value))))
Expand All @@ -244,7 +244,7 @@ function eval_script(block, sandbox, meta::Dict, doc::Documents.Document, page)
output = lstrip(output, '\n')
result = Result(block, input, output, meta[:CurrentFile])
for (ex, str) in Utilities.parseblock(input, doc, page; keywords = false, raise=false)
c = IOCapture.iocapture(throwerrors=false) do
c = IOCapture.iocapture(throwerrors = :interrupt) do
Core.eval(sandbox, ex)
end
result.value = c.value
Expand Down
4 changes: 2 additions & 2 deletions src/Expanders.jl
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,7 @@ function Selectors.runner(::Type{ExampleBlocks}, x, page, doc)
code = x.code
end
for (ex, str) in Utilities.parseblock(code, doc, page; keywords = false)
c = IOCapture.iocapture(throwerrors=false) do
c = IOCapture.iocapture(throwerrors = :interrupt) do
cd(page.workdir) do
Core.eval(mod, ex)
end
Expand Down Expand Up @@ -612,7 +612,7 @@ function Selectors.runner(::Type{REPLBlocks}, x, page, doc)
# see https://github.com/JuliaLang/julia/pull/33864
ex = REPL.softscope!(ex)
end
c = IOCapture.iocapture(throwerrors=false) do
c = IOCapture.iocapture(throwerrors = :interrupt) do
cd(page.workdir) do
Core.eval(mod, ex)
end
Expand Down
2 changes: 1 addition & 1 deletion test/TestUtilities.jl
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ function Base.showerror(io::IO, e::QuietlyException)
end

function _quietly(f, expr, source)
c = IOCapture.iocapture(f; throwerrors=false)
c = IOCapture.iocapture(f; throwerrors = :interrupt)
haskey(ENV, "DOCUMENTER_TEST_QUIETLY") && open(QUIETLY_LOG; write=true, append=true) do io
println(io, "@quietly: c.error = $(c.error) / $(sizeof(c.output)) bytes of output captured")
println(io, "@quietly: $(source.file):$(source.line)")
Expand Down
2 changes: 1 addition & 1 deletion test/doctests/doctestapi.jl
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import IOCapture
# ------------------------------------
function run_doctest(f, args...; kwargs...)
(result, success, backtrace, output) =
c = IOCapture.iocapture(throwerrors=false) do
c = IOCapture.iocapture(throwerrors = :interrupt) do
# Running inside a Task to make sure that the parent testsets do not interfere.
t = Task(() -> doctest(args...; kwargs...))
schedule(t)
Expand Down
2 changes: 1 addition & 1 deletion test/doctests/doctests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ function run_makedocs(f, mdfiles, modules=Module[]; kwargs...)
cp(joinpath(@__DIR__, "src", mdfile), joinpath(srcdir, mdfile))
end

c = IOCapture.iocapture(throwerrors=false) do
c = IOCapture.iocapture(throwerrors = :interrupt) do
makedocs(
sitename = " ",
root = dir,
Expand Down

0 comments on commit aea49fd

Please sign in to comment.