Add minimal support for Python 3.11

Part of eng/toolchain/gnatcoll-bindings#1
This commit is contained in:
Nicolas Roche
2023-10-31 11:30:57 +01:00
parent 411d4c6201
commit cd650de5e3
2 changed files with 14 additions and 2 deletions

View File

@@ -813,13 +813,21 @@ PyAPI_FUNC(PyObject *) PyFile_FromString
PyCodeObject*
ada_pyframe_get_code (PyFrameObject* obj)
{
#if PY_MAJOR_VERSION > 3 || (PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION > 8)
return PyFrame_GetCode(obj);
#else
return obj->f_code;
#endif
}
PyFrameObject*
ada_pyframe_get_back (PyFrameObject* obj)
{
#if PY_MAJOR_VERSION > 3 || (PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION > 8)
return PyFrame_GetBack(obj);
#else
return obj->f_back;
#endif
}
PyObject*