summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--numpy/core/src/multiarray/buffer.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/numpy/core/src/multiarray/buffer.c b/numpy/core/src/multiarray/buffer.c
index 5ba343d6d..3b3bba663 100644
--- a/numpy/core/src/multiarray/buffer.c
+++ b/numpy/core/src/multiarray/buffer.c
@@ -637,6 +637,8 @@ _buffer_get_info(PyObject *obj, int flags)
item = PyList_GetItem(item_list, item_list_length - 1);
old_info = (_buffer_info_t*)PyLong_AsVoidPtr(item);
if (_buffer_info_cmp(info, old_info) != 0) {
+ old_info = NULL; /* Can't use this one, but possibly next */
+
if (item_list_length > 1 && info->ndim > 1) {
/*
* Some arrays are C- and F-contiguous and if they have more
@@ -654,9 +656,6 @@ _buffer_get_info(PyObject *obj, int flags)
old_info = NULL;
}
}
- else {
- old_info = NULL;
- }
}
if (old_info != NULL) {