File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -129,7 +129,7 @@ cdef class SegmentationNormal:
129
129
mpcl_sacnormal_set_axis(deref(self .me),ax,ay,az)
130
130
131
131
132
- # Empirically determine strides, for buffer support.
132
+ # Empirically determine strides, for buffer protocol support.
133
133
# XXX Is there a more elegant way to get these?
134
134
cdef Py_ssize_t _strides[2 ]
135
135
cdef PointCloud _pc_tmp = PointCloud(np.array([[1 , 2 , 3 ],
@@ -196,9 +196,9 @@ cdef class PointCloud:
196
196
cdef Py_ssize_t npoints = self .thisptr().size()
197
197
198
198
if self ._view_count == 0 :
199
- self ._view_count += 1
200
199
self ._shape[0 ] = npoints
201
200
self ._shape[1 ] = 3
201
+ self ._view_count += 1
202
202
203
203
buffer .buf = < char * > & (cpp.getptr_at(self .thisptr(), 0 ).x)
204
204
buffer .format = ' f'
Original file line number Diff line number Diff line change @@ -53,6 +53,13 @@ def test_asarray(self):
53
53
a [:] += 6
54
54
assert_array_almost_equal (p [0 ], a [0 ])
55
55
56
+ # Regression test: deleting a second view would previously
57
+ # reset the view count to zero.
58
+ b = np .asarray (p )
59
+ del b
60
+
61
+ self .assertRaises (ValueError , p .resize , 2 * len (p ))
62
+
56
63
def test_pickle (self ):
57
64
"""Test pickle support."""
58
65
# In this testcase because picking reduces to pickling NumPy arrays.
You can’t perform that action at this time.
0 commit comments