Skip to content

Commit 28b1028

Browse files
BUG: avoid X += X.T (refs #4401)
1 parent 40bc54d commit 28b1028

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

scipy/sparse/linalg/dsolve/tests/test_linsolve.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,8 @@ def test_splu_perm(self):
346346

347347
# Now make a symmetric, and test that the two permutation vectors are
348348
# the same
349-
a += a.T
349+
# Note: a += a.T relies on undefined behavior.
350+
a = a + a.T
350351
a_ = csc_matrix(a)
351352
lu = splu(a_)
352353
assert_array_equal(lu.perm_r, lu.perm_c)

0 commit comments

Comments
 (0)