app_python3: proper check of PY_VERSION_HEX for python 3.11
authorDaniel-Constantin Mierla <miconda@gmail.com>
Fri, 13 Jan 2023 11:33:20 +0000 (12:33 +0100)
committerVictor Seva <vseva@debian.org>
Tue, 31 Jan 2023 19:10:56 +0000 (19:10 +0000)
Gbp-Pq: Name app_python3-proper-check-of-PY_VERSION_HEX-for-pytho.patch

src/modules/app_python3/apy_kemi.c

index 47a34a4cb6e04e80b5252d7daf08ab7f64bd474b..09d0560b3976791b148263d189350eb278e1846b 100644 (file)
@@ -1810,7 +1810,7 @@ PyObject *sr_apy_kemi_exec_func(PyObject *self, PyObject *args, int idx)
        PyObject *ret = NULL;
        PyThreadState *pstate = NULL;
        PyFrameObject *pframe = NULL;
-#if PY_VERSION_HEX >= 0x03100000
+#if PY_VERSION_HEX >= 0x030B0000
        PyCodeObject *pcode = NULL;
 #endif
        struct timeval tvb = {0}, tve = {0};
@@ -1836,7 +1836,7 @@ PyObject *sr_apy_kemi_exec_func(PyObject *self, PyObject *args, int idx)
                if(tdiff >= cfg_get(core, core_cfg, latency_limit_action)) {
                        pstate = PyThreadState_GET();
                        if (pstate != NULL) {
-#if PY_VERSION_HEX >= 0x03100000
+#if PY_VERSION_HEX >= 0x030B0000
                                pframe = PyThreadState_GetFrame(pstate);
                                if(pframe != NULL) {
                                        pcode = PyFrame_GetCode(pframe);
@@ -1846,7 +1846,7 @@ PyObject *sr_apy_kemi_exec_func(PyObject *self, PyObject *args, int idx)
 #endif
                        }
 
-#if PY_VERSION_HEX >= 0x03100000
+#if PY_VERSION_HEX >= 0x030B0000
                        LOG(cfg_get(core, core_cfg, latency_log),
                                        "alert - action KSR.%s%s%s(...)"
                                        " took too long [%u ms] (file:%s func:%s line:%d)\n",