Cleaner world-age fix for pyplot

pull/71/merge
Matti Pastell 2017-03-11 11:31:17 +02:00
parent 868efa8208
commit b0d2ccdba2
1 changed files with 7 additions and 4 deletions

View File

@ -211,10 +211,13 @@ function run_code(chunk::CodeChunk, report::Report, SandBox::Module)
#Save figures only in the end of chunk for PyPlot
if rcParams[:plotlib] == "PyPlot"
#Work around "old world"
(@eval savep1(x) = savefigs_pyplot(x))
savep2(x) = eval(Expr(:call, function() savep1(x) end))
savep2(report)
#Fix "world-age" issue
if VERSION >= v"0.5.0"
savep(x) = eval(Expr(:call, x-> savefigs_pyplot(x), x))
savep(report)
else
savefigs_pyplot(report)
end
end
return results