File: 0001-Compatibility-with-numpy-2.0.patch

package info (click to toggle)
numexpr 2.12.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 816 kB
  • sloc: python: 3,888; cpp: 3,871; ansic: 369; makefile: 203
file content (24 lines) | stat: -rw-r--r-- 626 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
From: Antonio Valentino <antonio.valentino@tiscali.it>
Date: Sat, 6 Apr 2024 15:24:37 +0000
Subject: Compatibility with numpy < 2.0

Forwarded: not-needed
---
 numexpr/interpreter.cpp | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/numexpr/interpreter.cpp b/numexpr/interpreter.cpp
index dbfcca1..1ddf6b1 100644
--- a/numexpr/interpreter.cpp
+++ b/numexpr/interpreter.cpp
@@ -61,6 +61,10 @@
 #define DEBUG_TEST 0
 #endif
 
+#if NPY_ABI_VERSION < 0x02000000
+  #define PyDataType_ELSIZE(descr) ((descr)->elsize)
+  #define PyDataType_SET_ELSIZE(descr, size) ((descr)->elsize = (size))
+#endif
 
 using namespace std;