From eb13c31ab6aa4e910bad8333090dbada9adc3ee9 Mon Sep 17 00:00:00 2001 From: Robin Deits Date: Mon, 18 Dec 2017 21:34:29 -0500 Subject: [PATCH] compatibility with julia v0.5 through v0.7 --- src/PATHSolver.jl | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/PATHSolver.jl b/src/PATHSolver.jl index 6160d9a..4f0a44f 100644 --- a/src/PATHSolver.jl +++ b/src/PATHSolver.jl @@ -71,10 +71,15 @@ function remove_option_file() end end +# Needed for compatibility with Julia v0.5 through v0.7 +@static if VERSION < v"0.7.0-" + pairs(x) = [(p[1] => p[2]) for p in x] +end + function options(;kwargs...) opt_file = open("path.opt", "w") println(opt_file, "* Generated by PATHSolver.jl. Do not edit.") - for (key, value) in kwargs + for (key, value) in pairs(kwargs) println(opt_file, key, " ", value) end close(opt_file)