- if not isinstance(inequality, LinExpr):
- raise TypeError('inequalities must be linear expressions')
- sc_inequalities.append(inequality.scaleint())
+ if isinstance(inequality, LinExpr):
+ sc_inequalities.append(inequality.scaleint())
+ elif isinstance(inequality, numbers.Rational):
+ sc_inequalities.append(Rational(inequality).scaleint())
+ else:
+ raise TypeError('inequalities must be linear expressions '
+ 'or rational numbers')