diff options
author | Charles Harris <charlesr.harris@gmail.com> | 2020-07-18 19:01:57 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-18 19:01:57 -0600 |
commit | a0028bca0117874606bce99261d978df8d3f6610 (patch) | |
tree | 6d0958d2355b434d4cadabd4ae0734e2f6ac150d | |
parent | 9765987c2ade250c82bfeaba49d1f9301211d63a (diff) | |
parent | be14f37b51a010f4c43b98f049dc48ac92ffa71f (diff) | |
download | numpy-a0028bca0117874606bce99261d978df8d3f6610.tar.gz |
Merge pull request #16899 from tacaswell/mnt_more_py310
MNT: also use Py_SET_REFCNT instead of Py_REFCNT
-rw-r--r-- | numpy/core/include/numpy/npy_3kcompat.h | 2 | ||||
-rw-r--r-- | numpy/core/src/multiarray/array_coercion.c | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/numpy/core/include/numpy/npy_3kcompat.h b/numpy/core/include/numpy/npy_3kcompat.h index 7e6b01924..4bc06fc96 100644 --- a/numpy/core/include/numpy/npy_3kcompat.h +++ b/numpy/core/include/numpy/npy_3kcompat.h @@ -65,6 +65,8 @@ static NPY_INLINE int PyInt_Check(PyObject *op) { #define Py_SET_TYPE(obj, type) ((Py_TYPE(obj) = (type)), (void)0) /* Introduced in https://github.com/python/cpython/commit/b10dc3e7a11fcdb97e285882eba6da92594f90f9 */ #define Py_SET_SIZE(obj, size) ((Py_SIZE(obj) = (size)), (void)0) + /* Introduced in https://github.com/python/cpython/commit/c86a11221df7e37da389f9c6ce6e47ea22dc44ff */ + #define Py_SET_REFCNT(obj, refcnt) ((Py_REFCNT(obj) = (refcnt)), (void)0) #endif diff --git a/numpy/core/src/multiarray/array_coercion.c b/numpy/core/src/multiarray/array_coercion.c index 9d367da1f..52cf24c41 100644 --- a/numpy/core/src/multiarray/array_coercion.c +++ b/numpy/core/src/multiarray/array_coercion.c @@ -434,7 +434,7 @@ PyArray_Pack(PyArray_Descr *descr, char *item, PyObject *value) .flags = NPY_ARRAY_WRITEABLE, /* assume array is not behaved. */ }; Py_SET_TYPE(&arr_fields, &PyArray_Type); - Py_REFCNT(&arr_fields) = 1; + Py_SET_REFCNT(&arr_fields, 1); if (NPY_UNLIKELY(descr->type_num == NPY_OBJECT)) { /* |