X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fpython.c;h=eed0591d395aed66ba373d3b02b208e65912adf3;hb=83077c18c3e78739c2d2d18debf99875944eaa72;hp=a3027e0dd36212cbdc6845b85cabaf0f878f398c;hpb=e94e1ca83a8ac255f045259ec898f944f9118430;p=collectd.git diff --git a/src/python.c b/src/python.c index a3027e0d..eed0591d 100644 --- a/src/python.c +++ b/src/python.c @@ -978,6 +978,7 @@ PyMODINIT_FUNC PyInit_collectd(void) { static int cpy_config(oconfig_item_t *ci) { int i; + char *argv = ""; PyObject *sys, *tb; PyObject *sys_path; PyObject *module; @@ -1017,6 +1018,9 @@ static int cpy_config(oconfig_item_t *ci) { cpy_log_exception("python initialization"); return 1; } + PySys_SetArgv(1, &argv); + PyList_SetSlice(sys_path, 0, 1, NULL); + #ifdef IS_PY3K module = PyImport_ImportModule("collectd"); #else