From 50f10b677b9823d1cc1d2827ba59c520a8ed9473 Mon Sep 17 00:00:00 2001 From: John Siirola Date: Fri, 11 Nov 2016 12:41:58 -0700 Subject: [PATCH] Prevent chainedInequality caching for inequalities that already have 3 terms. --- pyomo/core/base/expr_coopr3.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyomo/core/base/expr_coopr3.py b/pyomo/core/base/expr_coopr3.py index bcf981ce8b3..236a6ff4bdb 100755 --- a/pyomo/core/base/expr_coopr3.py +++ b/pyomo/core/base/expr_coopr3.py @@ -467,7 +467,7 @@ def __getstate__(self): def __nonzero__(self): if generate_relational_expression.chainedInequality is not None: raise TypeError(chainedInequalityErrorMessage()) - if not self.is_constant(): + if not self.is_constant() and len(self._args) == 2: generate_relational_expression.call_info \ = traceback.extract_stack(limit=2)[-2] generate_relational_expression.chainedInequality = self