diff options
author | Sebastian Berg <sebastian@sipsolutions.net> | 2022-01-11 21:03:08 -0600 |
---|---|---|
committer | Sebastian Berg <sebastian@sipsolutions.net> | 2022-01-14 20:07:07 -0600 |
commit | 334470edb1e4e4ea1bc87773ef6d0c6fd510486a (patch) | |
tree | b21af96d9d2d35918216fbf481cdbbbea2635944 | |
parent | e4d0e60d2b8383fe995c518b3eef0007b3e48ab4 (diff) | |
download | numpy-334470edb1e4e4ea1bc87773ef6d0c6fd510486a.tar.gz |
BUG: Fix growing when NPY_RELAXED_STRIDES_DEBUG=1 is used
-rw-r--r-- | numpy/core/src/multiarray/textreading/rows.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/numpy/core/src/multiarray/textreading/rows.c b/numpy/core/src/multiarray/textreading/rows.c index d5004613c..08bc80cc4 100644 --- a/numpy/core/src/multiarray/textreading/rows.c +++ b/numpy/core/src/multiarray/textreading/rows.c @@ -269,6 +269,12 @@ read_rows(stream *s, */ data_array = (PyArrayObject *)PyArray_SimpleNewFromDescr( ndim, result_shape, out_descr); +#ifdef NPY_RELAXED_STRIDES_DEBUG + /* Incompatible with NPY_RELAXED_STRIDES_DEBUG due to growing */ + if (result_shape[0] == 1) { + PyArray_STRIDES(data_array)[0] = row_size; + } +#endif /* NPY_RELAXED_STRIDES_DEBUG */ if (data_array == NULL) { goto error; } |