From: Arran Cudbard-Bell Date: Tue, 7 Feb 2023 21:10:29 +0000 (-0600) Subject: Can't embed conditions in macro args X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f9abc0944bea90ac1ce4d2a385c46706b2ca359b;p=thirdparty%2Ffreeradius-server.git Can't embed conditions in macro args --- diff --git a/src/modules/rlm_python/rlm_python.c b/src/modules/rlm_python/rlm_python.c index 489fec187aa..07c7ed44f33 100644 --- a/src/modules/rlm_python/rlm_python.c +++ b/src/modules/rlm_python/rlm_python.c @@ -224,20 +224,23 @@ static void python_error_log(module_ctx_t const *mctx, request_t *request) PyCodeObject *code = PyFrame_GetCode(cur_frame); #endif + +#if PY_VERSION_HEX >= 0x030A0000 ROPTIONAL(RERROR, ERROR, "[%ld] %s:%d at %s()", fnum, -#if PY_VERSION_HEX >= 0x030A0000 PyUnicode_AsUTF8(code->co_filename), -#else - PyUnicode_AsUTF8(cur_frame->f_code->co_filename), -#endif PyFrame_GetLineNumber(cur_frame), -#if PY_VERSION_HEX >= 0x30A0000 PyUnicode_AsUTF8(code->co_name) + ); #else - PyUnicode_AsUTF8(cur_frame->f_code->co_name) -#endif + ROPTIONAL(RERROR, ERROR, "[%ld] %s:%d at %s()", + fnum, + PyUnicode_AsUTF8(cur_frame->f_code->co_filename), + PyFrame_GetLineNumber(cur_frame), + PyUnicode_AsUTF8(cur_frame->f_code->co_name) ); +#endif + #if PY_VERSION_HEX >= 0x030A0000 Py_XDECREF(code); #endif