Skip to content

Commit 0781ae7

Browse files
committed
fix numpy2.2 bug
1 parent 3543608 commit 0781ae7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ortools/linear_solver/python/model_builder_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1478,7 +1478,7 @@ def assertLinearExpressionAlmostEqual(
14781478
) -> None:
14791479
"""Test that the two linear expressions are almost equal."""
14801480
self.assertEqual(len(expr1.variable_indices), len(expr2.variable_indices))
1481-
if expr1.variable_indices:
1481+
if len(expr1.variable_indices) > 0: # pylint: disable=g-explicit-length-test
14821482
self.assertSequenceEqual(expr1.variable_indices, expr2.variable_indices)
14831483
self.assertSequenceAlmostEqual(
14841484
expr1.coefficients, expr2.coefficients, places=5

0 commit comments

Comments
 (0)