18 lines
589 B
Diff
18 lines
589 B
Diff
--- a/libs/python/src/numpy/dtype.cpp
|
|
+++ b/libs/python/src/numpy/dtype.cpp
|
|
@@ -98,7 +98,13 @@
|
|
return python::detail::new_reference(reinterpret_cast<PyObject*>(obj));
|
|
}
|
|
|
|
-int dtype::get_itemsize() const { return reinterpret_cast<PyArray_Descr*>(ptr())->elsize;}
|
|
+int dtype::get_itemsize() const {
|
|
+#if NPY_ABI_VERSION < 0x02000000
|
|
+ return reinterpret_cast<PyArray_Descr*>(ptr())->elsize;
|
|
+#else
|
|
+ return PyDataType_ELSIZE(reinterpret_cast<PyArray_Descr*>(ptr()));
|
|
+#endif
|
|
+}
|
|
|
|
bool equivalent(dtype const & a, dtype const & b) {
|
|
// On Windows x64, the behaviour described on
|