8000 BUG,ENH: fix pickling user-scalars by allowing non-format buffer export by seberg · Pull Request #17295 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content

BUG,ENH: fix pickling user-scalars by allowing non-format buffer export #17295

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Nov 3, 2020
Prev Previous commit
MAINT: Simplify code path slightly
  • Loading branch information
seberg committed Oct 22, 2020
commit d02ca96090ea2fed97b7789a855668c1ddc98294
5 changes: 2 additions & 3 deletions numpy/core/src/multiarray/buffer.c
9481
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -654,9 +656,6 @@ _buffer_get_info(PyObject *obj, int flags)
old_info = NULL;
}
}
else {
old_info = NULL;
}
}

if (old_info != NULL) {
Expand Down
0