Merge branch 'collectd-5.4'
[collectd.git] / src / python.c
index 928c921..8b378a2 100644 (file)
@@ -1038,7 +1038,7 @@ static int cpy_init_python() {
        PyObject *module;
 
 #ifdef IS_PY3K
-       wchar_t *argv = {0};
+       wchar_t *argv = L"";
        /* Add a builtin module, before Py_Initialize */
        PyImport_AppendInittab("collectd", PyInit_collectd);
 #else
@@ -1159,8 +1159,8 @@ static int cpy_config(oconfig_item_t *ci) {
                                cpy_log_exception("python initialization");
                                continue;
                        }
-                       if (PyList_Append(sys_path, dir_object) != 0) {
-                               ERROR("python plugin: Unable to append \"%s\" to "
+                       if (PyList_Insert(sys_path, 0, dir_object) != 0) {
+                               ERROR("python plugin: Unable to prepend \"%s\" to "
                                      "python module path.", dir);
                                cpy_log_exception("python initialization");
                        }