#85: 'is None' should be 'is not None'
This commit is contained in:
parent
46086ea084
commit
aac2fc3f24
|
@ -1331,12 +1331,12 @@ class LpProblem(object):
|
|||
elif isinstance(other, LpConstraint):
|
||||
self.addConstraint(other, name)
|
||||
elif isinstance(other, LpAffineExpression):
|
||||
if self.objective is None:
|
||||
if self.objective is not None:
|
||||
warnings.warn("Overwriting previously set objective.")
|
||||
self.objective = other
|
||||
self.objective.name = name
|
||||
elif isinstance(other, LpVariable) or isinstance(other, (int, float)):
|
||||
if self.objective is None:
|
||||
if self.objective is not None:
|
||||
warnings.warn("Overwriting previously set objective.")
|
||||
self.objective = LpAffineExpression(other)
|
||||
self.objective.name = name
|
||||
|
|
Loading…
Reference in New Issue