From 81100dc0e3445e84f08089f258576a20211595ae Mon Sep 17 00:00:00 2001 From: Sven Trenkel Date: Sun, 6 Dec 2009 19:29:17 +0100 Subject: [PATCH] Clean up exceptions in places where we don't care about them. --- src/python.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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; -- 2.11.0