From: Sven Trenkel Date: Sun, 6 Dec 2009 18:29:17 +0000 (+0100) Subject: Clean up exceptions in places where we don't care about them. X-Git-Tag: collectd-4.9.0~35^2~7 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=81100dc0e3445e84f08089f258576a20211595ae;p=collectd.git Clean up exceptions in places where we don't care about them. --- diff --git a/src/python.c b/src/python.c index 434d931c..64649701 100644 --- a/src/python.c +++ b/src/python.c @@ -224,11 +224,13 @@ static void cpy_build_name(char *buf, size_t size, PyObject *callback, const cha if (module != NULL) { snprintf(buf, size, "python.%s", module); Py_XDECREF(mod); + PyErr_Clear(); return; } Py_XDECREF(mod); snprintf(buf, size, "python.%p", callback); + PyErr_Clear(); } static void cpy_log_exception(const char *context) { @@ -624,7 +626,7 @@ static PyObject *cpy_unregister_generic(cpy_callback_t **list_head, PyObject *ar PyErr_Format(PyExc_RuntimeError, "Unable to unregister %s callback '%s'.", desc, name); return NULL; } - /* Yes, this is actually save. To call this function the calles has to + /* Yes, this is actually save. To call this function the caller has to * hold the GIL. Well, save as long as there is only one GIL anyway ... */ if (prev == NULL) *list_head = tmp->next;