From 4d7a4442469636c0d4db16fa163b9d2b069e72ea Mon Sep 17 00:00:00 2001 From: Sebastian Pech Date: Wed, 21 Aug 2019 15:03:22 +0200 Subject: [PATCH] Fix displayed output produced by capture_output --- src/run.jl | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/run.jl b/src/run.jl index 7a241f3..77bc177 100644 --- a/src/run.jl +++ b/src/run.jl @@ -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)