Skip to content

Commit

Permalink
Fix use of invoke (#461)
Browse files Browse the repository at this point in the history
  • Loading branch information
yuyichao authored and stevengj committed Sep 12, 2016
1 parent 1b1cf6f commit a386048
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/IJulia.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
5 changes: 2 additions & 3 deletions src/execute_request.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions src/stdio.jl
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ function readline(io::StdioPipe)
end
end
else
invoke(readline, (supertype(StdioPipe),), io)
invoke(readline, Tuple{supertype(StdioPipe)}, io)
end
end

Expand Down Expand Up @@ -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")
Expand Down

0 comments on commit a386048

Please sign in to comment.