From: Nick Porter Date: Thu, 10 Apr 2025 16:57:23 +0000 (+0100) Subject: PyImport_AppendInittab can only be called before Py_Initialize X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7f3109411cc2cf9006d88e558a310ae1557509f3;p=thirdparty%2Ffreeradius-server.git PyImport_AppendInittab can only be called before Py_Initialize So, before the first interpeter is initialized --- 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 */