summaryrefslogtreecommitdiff
path: root/decoder.c
diff options
context:
space:
mode:
authorBert Vermeulen <bert@biot.com>2012-01-07 03:42:26 +0100
committerBert Vermeulen <bert@biot.com>2012-01-07 03:42:26 +0100
commitf9afa08467a7a11317f0e40145091a5945a54eda (patch)
treeb47dbdea22136b02cfe48d62c889785e93eb9fda /decoder.c
parent159699490ea4bf2495e99dcd5fb18b240d7499df (diff)
downloadlibsigrokdecode-f9afa08467a7a11317f0e40145091a5945a54eda.tar.gz
libsigrokdecode-f9afa08467a7a11317f0e40145091a5945a54eda.zip
check before calling PyObject_GetAttrString(): this throws an exception.
Diffstat (limited to 'decoder.c')
-rw-r--r--decoder.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/decoder.c b/decoder.c
index b590916..f06d5e9 100644
--- a/decoder.c
+++ b/decoder.c
@@ -134,7 +134,8 @@ int srd_load_decoder(const char *name, struct srd_decoder **dec)
/* Convert class annotation attribute to GSList of **char */
d->annotation = NULL;
- if ((py_annlist = PyObject_GetAttrString(py_res, "annotation"))) {
+ if (PyObject_HasAttrString(py_res, "annotation")) {
+ py_annlist = PyObject_GetAttrString(py_res, "annotation");
if (!PyList_Check(py_annlist)) {
srd_err("Protocol decoder module %s annotation should be a list", name);
return SRD_ERR_PYTHON;