]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Can't embed conditions in macro args
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Tue, 7 Feb 2023 21:10:29 +0000 (15:10 -0600)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Tue, 7 Feb 2023 21:10:29 +0000 (15:10 -0600)
src/modules/rlm_python/rlm_python.c

index 489fec187aa39ac493f36d5eee67dd21b621e2e9..07c7ed44f332d434b92e68db66771fdd120e1c3c 100644 (file)
@@ -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