diff options
author | Carlos Aznarán Laos | 2022-07-17 11:24:49 -0500 |
---|---|---|
committer | Carlos Aznarán Laos | 2022-07-17 11:24:49 -0500 |
commit | e626acabd041069861311f314ac3dbe9e6fd24b7 (patch) | |
tree | f23d6148ec822d2b2438327a5397e5e59fbe4a22 /numpy-compatibility.patch | |
parent | cc731bdc1dab7f0e5644ba398e0fbec62a35a677 (diff) | |
download | aur-e626acabd041069861311f314ac3dbe9e6fd24b7.tar.gz |
Add upstream patch for NumPy 1.23.0 or later compatibility
Diffstat (limited to 'numpy-compatibility.patch')
-rw-r--r-- | numpy-compatibility.patch | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/numpy-compatibility.patch b/numpy-compatibility.patch new file mode 100644 index 000000000000..98ed4eaa924a --- /dev/null +++ b/numpy-compatibility.patch @@ -0,0 +1,25 @@ +diff --git a/dynd/include/numpy_interop.hpp b/dynd/include/numpy_interop.hpp +index 8036b8f..c109407 100644 +--- a/dynd/include/numpy_interop.hpp ++++ b/dynd/include/numpy_interop.hpp +@@ -33,7 +33,6 @@ + #define NPY_ARRAY_NOTSWAPPED NPY_NOTSWAPPED + #define NPY_ARRAY_ALIGNED NPY_ALIGNED + #define NPY_ARRAY_WRITEABLE NPY_WRITEABLE +-#define NPY_ARRAY_UPDATEIFCOPY NPY_UPDATEIFCOPY + #endif + + #define PY_ARRAY_UNIQUE_SYMBOL pydynd_ARRAY_API +diff --git a/dynd/src/numpy_interop.cpp b/dynd/src/numpy_interop.cpp +index 24f445b..767ff4a 100644 +--- a/dynd/src/numpy_interop.cpp ++++ b/dynd/src/numpy_interop.cpp +@@ -524,7 +524,7 @@ dynd::nd::array pydynd::array_from_numpy_array(PyArrayObject *obj, + // Get a shared pointer that tracks buffer ownership + PyObject *base = PyArray_BASE(obj); + dynd::intrusive_ptr<dynd::memory_block_data> memblock; +- if (base == NULL || (PyArray_FLAGS(obj) & NPY_ARRAY_UPDATEIFCOPY) != 0) { ++ if (base == NULL || (PyArray_FLAGS(obj) & NPY_ARRAY_WRITEBACKIFCOPY) != 0) { + Py_INCREF(obj); + memblock = dynd::make_external_memory_block(obj, py_decref_function); + }
\ No newline at end of file |