X-Git-Url: https://sigrok.org/gitweb/?p=libsigrokdecode.git;a=blobdiff_plain;f=decoder.c;h=f06d5e9e5a2efae5351c6af8fc695fd6fa2c4b11;hp=b5909168fec43b15528a1510ecc3d87eb750b9f2;hb=f9a3947a7a8d884de6c55693b216f89b1d27d979;hpb=159699490ea4bf2495e99dcd5fb18b240d7499df 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;