]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
PyImport_AppendInittab can only be called before Py_Initialize
authorNick Porter <nick@portercomputing.co.uk>
Thu, 10 Apr 2025 16:57:23 +0000 (17:57 +0100)
committerNick Porter <nick@portercomputing.co.uk>
Thu, 10 Apr 2025 16:57:23 +0000 (17:57 +0100)
So, before the first interpeter is initialized

src/modules/rlm_python3/rlm_python3.c

index 52347a8113c3ee0d4818b3322cd9c293791f0835..ffc1df687154639dd8e3b1ed487b3370c3041aff 100644 (file)
@@ -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
                 */