1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-01-07 06:40:06 +00:00

devel/py-ice: Unbreak build

This commit is contained in:
Michael Gmelin 2024-06-05 11:06:09 +02:00
parent 3f7756e2ea
commit 81a7884cfd
2 changed files with 29 additions and 0 deletions

View File

@ -0,0 +1,15 @@
--- python/modules/IcePy/Slice.cpp.orig 2024-06-05 08:43:42 UTC
+++ python/modules/IcePy/Slice.cpp
@@ -20,8 +20,12 @@
//
// Python headers needed for PyEval_EvalCode.
//
+#if PY_VERSION_HEX >= 0x02050000 && PY_VERSION_HEX < 0x030B0000
#include <compile.h>
#include <eval.h>
+#else
+#include <compile.h>
+#endif
using namespace std;
using namespace IcePy;

View File

@ -0,0 +1,14 @@
--- python/modules/IcePy/Util.cpp.orig 2024-06-05 08:44:17 UTC
+++ python/modules/IcePy/Util.cpp
@@ -214,7 +214,11 @@ IcePy::getFunction()
//
// Get name of current function.
//
+#if PY_VERSION_HEX >= 0x02050000 && PY_VERSION_HEX < 0x030B0000
PyFrameObject *f = PyThreadState_GET()->frame;
+#else
+ PyFrameObject *f = PyThreadState_GetFrame(PyThreadState_GET());
+#endif
PyObjectHandle code = PyObject_GetAttrString(reinterpret_cast<PyObject*>(f), STRCAST("f_code"));
assert(code.get());
PyObjectHandle func = PyObject_GetAttrString(code.get(), STRCAST("co_name"));