]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Py_GetPath is deprecated and will be remove.
authorAlan T. DeKok <aland@freeradius.org>
Wed, 12 Mar 2025 04:31:08 +0000 (06:31 +0200)
committerAlan T. DeKok <aland@freeradius.org>
Wed, 12 Mar 2025 04:56:17 +0000 (06:56 +0200)
People can just print sys.path if they need to see what it is

It would be nice for the python API documentation to help here.
It says Py_GetPath is deprecated, and to look at sys.path instead.
But it doesn't say how to get sys.path from the API.  A quick look
around shows how to get sys.path from the Python code, but not
from the API.

Instead of doing the right thing, we just remove the deprecated
code.

src/modules/rlm_python/rlm_python.c

index 764dbff74487a6f02aafdeddd95805617881da3b..f574f95662fad80605f69c11da2ea7f90e7a663c 100644 (file)
@@ -1098,7 +1098,6 @@ static int libpython_init(void)
        PyConfig        config;
        PyStatus        status;
        wchar_t         *wide_name;
-       char            *path;
 
        fr_assert(!Py_IsInitialized());
 
@@ -1166,13 +1165,6 @@ static int libpython_init(void)
 
        PyConfig_Clear(&config);
 
-       /*
-        *      Report the path
-        */
-       path = Py_EncodeLocale(Py_GetPath(), NULL);
-       LOAD_INFO("Python path set to \"%s\"", path);
-       PyMem_Free(path);
-
        global_interpreter = PyEval_SaveThread();       /* Store reference to the main interpreter and release the GIL */
 
        return 0;