diff options
| author | mattip <matti.picus@gmail.com> | 2022-12-29 10:25:42 +0200 |
|---|---|---|
| committer | mattip <matti.picus@gmail.com> | 2022-12-29 10:27:24 +0200 |
| commit | 845a327f4ff81bb55d6a15906bd65de375a34958 (patch) | |
| tree | cdccce130fbf05417355b529ba10fb9b11f160ab /numpy/core/src | |
| parent | 8b3056c1a7faca2a781febf87a7c9e5a6829e472 (diff) | |
| download | numpy-845a327f4ff81bb55d6a15906bd65de375a34958.tar.gz | |
use better semantics for calling PyArray_DiscardWritebackIfCopy
Diffstat (limited to 'numpy/core/src')
| -rw-r--r-- | numpy/core/src/umath/ufunc_object.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/numpy/core/src/umath/ufunc_object.c b/numpy/core/src/umath/ufunc_object.c index 86d0a767a..f928eb33b 100644 --- a/numpy/core/src/umath/ufunc_object.c +++ b/numpy/core/src/umath/ufunc_object.c @@ -6466,7 +6466,7 @@ fail: */ if (res != 0 || PyErr_Occurred()) { /* iter_buffer has already been deallocated, don't use NpyIter_Dealloc */ - if (op1_array != (PyArrayObject*)op1) { + if (PyArray_FLAGS(op1_array) & NPY_ARRAY_WRITEBACKIFCOPY) { PyArray_DiscardWritebackIfCopy(op1_array); } return NULL; |
