X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fpyconfig.c;h=b5c01aaf1d5481256bf872e6d078c6e4b74dc15c;hb=7cea19815ba24735e91dde1c08a889960b299b62;hp=53e80e43fba9c9142034055b455e652dd9d02fea;hpb=50b21162a21571facd6bbd8a8f9e694dbd7d02e1;p=collectd.git diff --git a/src/pyconfig.c b/src/pyconfig.c index 53e80e43..b5c01aaf 100644 --- a/src/pyconfig.c +++ b/src/pyconfig.c @@ -125,20 +125,21 @@ static PyObject *Config_repr(PyObject *s) { /* This is ok because we have the GIL, so this is thread-save by default. */ if (node_prefix == NULL) - node_prefix = cpy_string_to_unicode_or_bytes(""); + ending = cpy_string_to_unicode_or_bytes(">"); if (node_prefix == NULL || root_prefix == NULL || ending == NULL) return NULL; ret = PyObject_Str(self->key); + CPY_SUBSTITUTE(PyObject_Repr, ret, ret); if (self->parent == NULL || self->parent == Py_None) - CPY_SUBSTITUTE(CPY_STRCAT, ret, root_prefix, ret); + CPY_STRCAT(&ret, root_prefix); else - CPY_SUBSTITUTE(CPY_STRCAT, ret, node_prefix, ret); - CPY_SUBSTITUTE(CPY_STRCAT, ret, ret, ending); + CPY_STRCAT(&ret, node_prefix); + CPY_STRCAT(&ret, ending); return ret; }