diff options
author | Eric Wieser <wieser.eric@gmail.com> | 2018-08-11 16:01:48 -0700 |
---|---|---|
committer | Eric Wieser <wieser.eric@gmail.com> | 2018-10-30 22:36:24 -0700 |
commit | f2d8aabaf99bc2c460968d64aec67ae2570726bd (patch) | |
tree | 59ca29177191ff6be96eaa1469a3ee2c6da68cce /numpy/ma | |
parent | 7a0950649db5b83a881d8fb2bf8f95fdd885e081 (diff) | |
download | numpy-f2d8aabaf99bc2c460968d64aec67ae2570726bd.tar.gz |
BUG: Make `arr.ctypes.data` hold onto a reference to the underlying array
We do this by going through ctypes.from_buffer, which keeps the object the buffer came from alive.
A bunch of hacks are required to produce a sufficiently simple buffer for ctypes to accept.
Fixes #9647
Diffstat (limited to 'numpy/ma')
-rw-r--r-- | numpy/ma/tests/test_core.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/numpy/ma/tests/test_core.py b/numpy/ma/tests/test_core.py index 8a015e609..4dfc12290 100644 --- a/numpy/ma/tests/test_core.py +++ b/numpy/ma/tests/test_core.py @@ -2390,9 +2390,9 @@ class TestMaskedArrayInPlaceArithmetics(object): assert_equal(xm, y + 1) (x, _, xm) = self.floatdata - id1 = x.data.ctypes._data + id1 = x.data.ctypes.data x += 1. - assert_(id1 == x.data.ctypes._data) + assert_(id1 == x.data.ctypes.data) assert_equal(x, y + 1.) def test_inplace_addition_array(self): |