8000 MAINT: use PyArray_ClearBuffer in PyArray_FillWithScalar · seiko2plus/numpy@84571a1 · GitHub
[go: up one dir, main page]

Skip to content

Commit 84571a1

Browse files
committed
MAINT: use PyArray_ClearBuffer in PyArray_FillWithScalar
1 parent 95eeb2a commit 84571a1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

numpy/core/src/multiarray/convert.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121

2222
#include "convert.h"
2323
#include "array_coercion.h"
24+
#include "refcount.h"
2425

2526
int
2627
fallocate(int fd, int mode, off_t offset, off_t len);
@@ -416,7 +417,7 @@ PyArray_FillWithScalar(PyArrayObject *arr, PyObject *obj)
416417
descr, value);
417418

418419
if (PyDataType_REFCHK(descr)) {
419-
PyArray_Item_XDECREF(value, descr);
420+
PyArray_ClearBuffer(descr, value, 0, 1, 1);
420421
}
421422
PyMem_FREE(value_buffer_heap);
422423
return retcode;

0 commit comments

Comments
 (0)
0