diff options
| author | Sebastian Berg <sebastianb@nvidia.com> | 2023-03-29 20:34:01 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-03-29 20:34:01 +0200 |
| commit | 3e77f904a9cc82e03d20824425e30edcd8088484 (patch) | |
| tree | 244f84d255e44d1220994ff279304b66e4334859 | |
| parent | 95eeb2a45f76062bcf77101fcd14067ca8075166 (diff) | |
| parent | 84571a1b20123b57e81e7e88cc3ceef637b54f8e (diff) | |
| download | numpy-3e77f904a9cc82e03d20824425e30edcd8088484.tar.gz | |
Merge pull request #23484 from ngoldbaum/fill-clear
MAINT: use PyArray_ClearBuffer in PyArray_FillWithScalar
| -rw-r--r-- | numpy/core/src/multiarray/convert.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/numpy/core/src/multiarray/convert.c b/numpy/core/src/multiarray/convert.c index e99bc3fe4..9e0c9fb60 100644 --- a/numpy/core/src/multiarray/convert.c +++ b/numpy/core/src/multiarray/convert.c @@ -21,6 +21,7 @@ #include "convert.h" #include "array_coercion.h" +#include "refcount.h" int fallocate(int fd, int mode, off_t offset, off_t len); @@ -416,7 +417,7 @@ PyArray_FillWithScalar(PyArrayObject *arr, PyObject *obj) descr, value); if (PyDataType_REFCHK(descr)) { - PyArray_Item_XDECREF(value, descr); + PyArray_ClearBuffer(descr, value, 0, 1, 1); } PyMem_FREE(value_buffer_heap); return retcode; |
