File tree Expand file tree Collapse file tree 1 file changed +3
-7
lines changed Expand file tree Collapse file tree 1 file changed +3
-7
lines changed Original file line number Diff line number Diff line change 2727from pyomo .common .gc_manager import PauseGC
2828from pyomo .common .modeling import unique_component_name
2929from pyomo .common .dependencies import dill , dill_available , multiprocessing
30+ from pyomo .common .enums import SolverAPIVersion
3031
3132from pyomo .core import (
3233 Block ,
5455from pyomo .gdp .plugins .gdp_to_mip_transformation import GDP_to_MIP_Transformation
5556from pyomo .gdp .util import _to_dict
5657from pyomo .opt import SolverFactory , TerminationCondition
57- from pyomo .contrib .solver .common .base import SolverBase as NewSolverBase
58- from pyomo .contrib .solver .common .base import LegacySolverWrapper
5958from pyomo .repn import generate_standard_repn
6059
6160from weakref import ref as weakref_ref
@@ -92,11 +91,8 @@ def Solver(val):
9291 return SolverFactory (val )
9392 if not hasattr (val , 'solve' ):
9493 raise ValueError ("Expected a string or solver object (with solve() method)" )
95- if isinstance (val , NewSolverBase ) and not isinstance (val , LegacySolverWrapper ):
96- raise ValueError (
97- "Please pass an old-style solver object, using the "
98- "LegacySolverWrapper mechanism if necessary."
99- )
94+ if not hasattr (val , 'api_version' ) or val .api_version () is not SolverAPIVersion .V1 :
95+ raise ValueError ("Solver object should support the V1 solver API version" )
10096 return val
10197
10298
You can’t perform that action at this time.
0 commit comments