Skip to content

Commit

Permalink
Fix import expression for Julia 1.2 (#1909)
Browse files Browse the repository at this point in the history
* Fix import expression for Julia 1.2

* Keep old import syntax on old Julia versions
  • Loading branch information
iamed2 authored and mlubin committed Mar 27, 2019
1 parent d8f526d commit f67fecf
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/JuMP.jl
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,12 @@ function MathProgBase.numconstr(m::Model)
end

for f in MathProgBase.SolverInterface.methods_by_tag[:rewrap]
eval(Expr(:import,:MathProgBase,f))
# both versions are allowed from 0.7 through 1.1
@static if VERSION >= v"1.0"
eval(Expr(:import,Expr(:.,:MathProgBase,f)))
else
eval(Expr(:import,:MathProgBase,f))
end
@eval function $f(m::Model)
# check internal model exists
if !m.internalModelLoaded
Expand Down

0 comments on commit f67fecf

Please sign in to comment.