diff options
author | Bert Vermeulen <bert@biot.com> | 2012-01-23 04:51:33 +0100 |
---|---|---|
committer | Bert Vermeulen <bert@biot.com> | 2012-01-23 04:53:32 +0100 |
commit | 2086c68463fef416fd9a48dac5e1aa7fa593308d (patch) | |
tree | afd3cb6c91ad59aeab95eec65dde66ee4e55e30d /type_decoder.c | |
parent | ec871a279893cfe0ab378eddc0a9f9bcccc44925 (diff) | |
download | libsigrokdecode-2086c68463fef416fd9a48dac5e1aa7fa593308d.tar.gz libsigrokdecode-2086c68463fef416fd9a48dac5e1aa7fa593308d.zip |
srd: use new exception system everywhere
Diffstat (limited to 'type_decoder.c')
-rw-r--r-- | type_decoder.c | 8 |
1 files changed, 3 insertions, 5 deletions
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; } |