Skip to content

Commit

Permalink
app_python3: proper check of PY_VERSION_HEX for python 3.11
Browse files Browse the repository at this point in the history
  • Loading branch information
miconda committed Jan 13, 2023
1 parent ddefe42 commit 8546fb8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/modules/app_python3/apy_kemi.c
Expand Up @@ -337,7 +337,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};
Expand All @@ -363,7 +363,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);
Expand All @@ -373,7 +373,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",
Expand Down

0 comments on commit 8546fb8

Please sign in to comment.