From a38604878247a0c4a2c6649fa9f9417eb63221c0 Mon Sep 17 00:00:00 2001 From: Yichao Yu Date: Sun, 11 Sep 2016 21:08:01 -0400 Subject: [PATCH] Fix use of `invoke` (#461) --- src/IJulia.jl | 2 +- src/execute_request.jl | 5 ++--- src/stdio.jl | 4 ++-- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/IJulia.jl b/src/IJulia.jl index 39084271..ddd946ca 100644 --- a/src/IJulia.jl +++ b/src/IJulia.jl @@ -187,7 +187,7 @@ end # since a range could be huge, intersect it with 1:n first clear_history{T<:Integer}(r::Range{T}) = - invoke(clear_history, (Any,), intersect(r, 1:n)) + invoke(clear_history, Tuple{Any}, intersect(r, 1:n)) function clear_history() empty!(In) diff --git a/src/execute_request.jl b/src/execute_request.jl index 7d174574..8ca7f4d8 100644 --- a/src/execute_request.jl +++ b/src/execute_request.jl @@ -176,10 +176,9 @@ function execute_request(socket, msg) undisplay(result) # dequeue if needed, since we display result in pyout display() # flush pending display requests - if result != nothing + if result !== nothing # Work around for Julia issue #265 (see # #7884 for context) - # We have to explicitly invoke the correct metadata method. - result_metadata = invoke(metadata, (typeof(result),), result) + result_metadata = eval(:(metadata($(QuoteNode(result))))) send_ipython(publish[], msg_pub(msg, "execute_result", Dict("execution_count" => n, diff --git a/src/stdio.jl b/src/stdio.jl index 61540a69..272d5e09 100644 --- a/src/stdio.jl +++ b/src/stdio.jl @@ -147,7 +147,7 @@ function readline(io::StdioPipe) end end else - invoke(readline, (supertype(StdioPipe),), io) + invoke(readline, Tuple{supertype(StdioPipe)}, io) end end @@ -181,7 +181,7 @@ end import Base.flush function flush(io::StdioPipe) - invoke(flush, (supertype(StdioPipe),), io) + invoke(flush, Tuple{supertype(StdioPipe)}, io) if io == STDOUT oslibuv_flush() send_stream("stdout")