From d5a67b5b421c12cc46d9bcd07ddc4b91c1e5fef3 Mon Sep 17 00:00:00 2001 From: Stephan Hoyer Date: Sun, 1 Mar 2015 14:23:07 -0800 Subject: BUG: fix broadcast_to for reference types --- numpy/lib/stride_tricks.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'numpy/lib/stride_tricks.py') diff --git a/numpy/lib/stride_tricks.py b/numpy/lib/stride_tricks.py index 0f46ed335..a5f247abf 100644 --- a/numpy/lib/stride_tricks.py +++ b/numpy/lib/stride_tricks.py @@ -60,9 +60,9 @@ def _broadcast_to(array, shape, subok, readonly): if any(size < 0 for size in shape): raise ValueError('all elements of broadcast shape must be non-' 'negative') - broadcast = np.nditer((array,), flags=['multi_index', 'zerosize_ok'], - op_flags=['readonly'], itershape=shape, order='C' - ).itviews[0] + broadcast = np.nditer( + (array,), flags=['multi_index', 'refs_ok', 'zerosize_ok'], + op_flags=['readonly'], itershape=shape, order='C').itviews[0] result = _maybe_view_as_subclass(array, broadcast) if not readonly and array.flags.writeable: result.flags.writeable = True -- cgit v1.2.1