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