mcst-linux-kernel/patches-2024.06.26/python3-pyside2-5.15.10/0002-fix-build-with-numpy-1...

23 lines
969 B
Diff

Link: https://bugreports.qt.io/browse/PYSIDE-2035
Subject: libshiboken: Fix build with numpy 1.23.0
Bug: 148771
Tags: common
diff -rupN a/sources/shiboken2/libshiboken/sbknumpyarrayconverter.cpp b/sources/shiboken2/libshiboken/sbknumpyarrayconverter.cpp
--- a/sources/shiboken2/libshiboken/sbknumpyarrayconverter.cpp 2023-04-04 23:37:59.108794011 +0300
+++ b/sources/shiboken2/libshiboken/sbknumpyarrayconverter.cpp 2023-04-04 23:38:54.455375459 +0300
@@ -116,8 +116,13 @@ std::ostream &operator<<(std::ostream &s
str << " NPY_ARRAY_NOTSWAPPED";
if ((flags & NPY_ARRAY_WRITEABLE) != 0)
str << " NPY_ARRAY_WRITEABLE";
+#if NPY_VERSION >= 0x00000010 // NPY_1_23_API_VERSION
+ if ((flags & NPY_ARRAY_WRITEBACKIFCOPY) != 0)
+ str << " NPY_ARRAY_WRITEBACKIFCOPY";
+#else
if ((flags & NPY_ARRAY_UPDATEIFCOPY) != 0)
str << " NPY_ARRAY_UPDATEIFCOPY";
+#endif
} else {
str << '0';
}