aboutsummaryrefslogtreecommitdiff
path: root/gnu/packages/patches/python-zeroc-ice-3.6.5-python-3.11-support.patch
blob: 17cae7297c0b2a483f66b38c2d99f7a6ba572437 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
Only in zeroc-ice-3.6.5: setup.py.orig
diff --color -ur zeroc-ice-3.6.5.orig/src/Slice.cpp zeroc-ice-3.6.5/src/Slice.cpp
--- zeroc-ice-3.6.5.orig/src/Slice.cpp	2019-07-31 21:49:38.000000000 +0200
+++ zeroc-ice-3.6.5/src/Slice.cpp	2023-10-12 10:52:07.029069937 +0200
@@ -17,12 +17,6 @@
 #include <Slice/Util.h>
 #include <IceUtil/Options.h>
 
-//
-// Python headers needed for PyEval_EvalCode.
-//
-#include <compile.h>
-#include <eval.h>
-
 using namespace std;
 using namespace IcePy;
 using namespace Slice;
diff --color -ur zeroc-ice-3.6.5.orig/src/Util.cpp zeroc-ice-3.6.5/src/Util.cpp
--- zeroc-ice-3.6.5.orig/src/Util.cpp	2019-07-31 21:49:38.000000000 +0200
+++ zeroc-ice-3.6.5/src/Util.cpp	2023-10-12 10:49:15.033366926 +0200
@@ -214,7 +214,12 @@
     //
     // Get name of current function.
     //
+    // Use PyEval_GetFrame with Pyhthon >= 3.11
+#if PY_VERSION_HEX >= 0x030B0000
+    PyFrameObject *f = PyEval_GetFrame();
+#else
     PyFrameObject *f = PyThreadState_GET()->frame;
+#endif
     PyObjectHandle code = PyObject_GetAttrString(reinterpret_cast<PyObject*>(f), STRCAST("f_code"));
     assert(code.get());
     PyObjectHandle func = PyObject_GetAttrString(code.get(), STRCAST("co_name"));