summaryrefslogtreecommitdiff
path: root/numpy/doc/structured_arrays.py
diff options
context:
space:
mode:
authorGary Gurlaskie <garygurlaskie@gmail.com>2019-06-11 08:12:50 -0700
committerSebastian Berg <sebastian@sipsolutions.net>2019-06-11 10:12:50 -0500
commitbc3c7176987a5017126abbc861458fe53cd099fc (patch)
treef19067d505df6bd902d9400e4731e97dc41cc818 /numpy/doc/structured_arrays.py
parent31bb4ca66b040088e0ffa0b56070708801db12d0 (diff)
downloadnumpy-bc3c7176987a5017126abbc861458fe53cd099fc.tar.gz
BUG: fix segfault on side-effect in __bool__ function in array.nonzero() (#13745)
We are using a two pass algorithm to first discover the number of nonzero elements and then fill the result array. This can cause segmentation faults or inconsistent results with buggy objects that change their truthiness during iteration. Closes gh-13631. * BUG: fix segfault on side-effect in __bool__ function in array.nonzero() Numpy should throw an exception here, instead of segfaulting. * MAINT: fix for review comments in array.nonzero() Now we check for both over-counting and under-counting. Fixed warnings causing failing build. * MAINT: fix for review comments Moved np.nonzero test to core/tests/test_numeric.py. Refactor to use assert_raises(). * Update test_numeric.py
Diffstat (limited to 'numpy/doc/structured_arrays.py')
0 files changed, 0 insertions, 0 deletions