diff --git a/pyomo/contrib/appsi/solvers/copt.py b/pyomo/contrib/appsi/solvers/copt.py index fbeed45e8ff..1572815bad6 100644 --- a/pyomo/contrib/appsi/solvers/copt.py +++ b/pyomo/contrib/appsi/solvers/copt.py @@ -342,11 +342,10 @@ def _solve(self, timer: HierarchicalTimer): config = self.config options = self.copt_options - if config.stream_solver: - self._solver_model.setParam('LogToConsole', 1) - else: - self._solver_model.setParam('LogToConsole', 0) - self._solver_model.setLogFile(config.logfile) + if not config.stream_solver: + self._solver_model.setParam("LogToConsole", 0) + if config.logfile: + self._solver_model.setLogFile(config.logfile) if config.time_limit is not None: self._solver_model.setParam('TimeLimit', config.time_limit) @@ -1068,7 +1067,7 @@ def get_slacks(self, cons_to_load=None): return slack def update(self, timer: HierarchicalTimer = None): - pass + super(Copt, self).update(timer=timer) def get_model_attr(self, attr): """