Merge pull request #239 from sebastianpech/Fixcaptureoutput

Fix displayed output produced by capture_output
pull/243/head
Tamas Nagy 2019-08-22 10:59:02 -07:00 committed by GitHub
commit 51903c3df3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 4 deletions

View File

@ -228,14 +228,12 @@ function capture_output(expr, SandBox::Module, term, disp,
reader = @async read(rw, String)
try
obj = Core.eval(SandBox, expr)
if (term || disp) && typeof(expr) == Expr && expr.head != :toplevel
if (term || disp) && (typeof(expr) != Expr || expr.head != :toplevel)
obj != nothing && display(obj)
elseif typeof(expr) == Symbol
display(obj)
#This shows images and lone variables, result can
#Handle last line sepately
elseif lastline && obj != nothing
(expr.head != :toplevel) && display(obj)
(typeof(expr) != Expr || expr.head != :toplevel) && display(obj)
end
catch E
throw_errors && throw(E)