From 7f3109411cc2cf9006d88e558a310ae1557509f3 Mon Sep 17 00:00:00 2001 From: Nick Porter Date: Thu, 10 Apr 2025 17:57:23 +0100 Subject: [PATCH] PyImport_AppendInittab can only be called before Py_Initialize So, before the first interpeter is initialized --- src/modules/rlm_python3/rlm_python3.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/rlm_python3/rlm_python3.c b/src/modules/rlm_python3/rlm_python3.c index 52347a8113..ffc1df6871 100644 --- a/src/modules/rlm_python3/rlm_python3.c +++ b/src/modules/rlm_python3/rlm_python3.c @@ -1121,7 +1121,7 @@ static int python_interpreter_init(rlm_python_t *inst, CONF_SECTION *conf) /* * prepare radiusd module to be loaded */ - if (!inst->cext_compat || !main_module) { + if ((!inst->cext_compat || !main_module) && (python_instances == 0)) { /* * This is ugly, but there is no other way to pass parameters to PyMODINIT_FUNC */ -- 2.47.2