From 962f0d1e583742a3142913f336a62f8c96b76cf6 Mon Sep 17 00:00:00 2001 From: Giorgio Calderone Date: Wed, 1 Apr 2020 11:23:27 +0200 Subject: [PATCH] Automatically enable dry sessions when gnuplot can not be executed --- src/Gnuplot.jl | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/Gnuplot.jl b/src/Gnuplot.jl index 293fac2..69895d1 100644 --- a/src/Gnuplot.jl +++ b/src/Gnuplot.jl @@ -315,9 +315,17 @@ function GPSession(sid::Symbol) return nothing end - - gpversion() session = DrySession(sid) + if !options.dry + try + gpversion() + catch + @warn "Cound not start a gnuplot process with command \"$(options.cmd)\". Enabling dry sessions..." + options.dry = true + sessions[sid] = session + return session + end + end pin = Base.Pipe() pout = Base.Pipe()