From 2086c68463fef416fd9a48dac5e1aa7fa593308d Mon Sep 17 00:00:00 2001 From: Bert Vermeulen Date: Mon, 23 Jan 2012 04:51:33 +0100 Subject: srd: use new exception system everywhere --- type_decoder.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'type_decoder.c') diff --git a/type_decoder.c b/type_decoder.c index ab5182f..86ccf02 100644 --- a/type_decoder.c +++ b/type_decoder.c @@ -126,8 +126,7 @@ static PyObject *Decoder_put(PyObject *self, PyObject *args) Py_XINCREF(next_di->py_instance); if (!(py_res = PyObject_CallMethod(next_di->py_instance, "decode", "KKO", start_sample, end_sample, data))) { - if (PyErr_Occurred()) - PyErr_Print(); + catch_exception("calling %s decode(): ", next_di->instance_id); } Py_XDECREF(py_res); } @@ -155,14 +154,13 @@ static PyObject *Decoder_add(PyObject *self, PyObject *args) int output_type, pdo_id; if (!(di = get_di_by_decobject(self))) { - srd_dbg("srd: %s():%d decoder instance not found", __func__, __LINE__); + srd_dbg("srd: decoder instance not found"); PyErr_SetString(PyExc_Exception, "decoder instance not found"); return NULL; } if (!PyArg_ParseTuple(args, "is", &output_type, &proto_id)) { - if (PyErr_Occurred()) - PyErr_Print(); + catch_exception(""); return NULL; } -- cgit v1.2.3-70-g09d2