projects
/
libsigrokdecode.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
87998e9
)
srd: handle missing module docstrings better
author
Bert Vermeulen
<bert@biot.com>
Sun, 15 Jan 2012 03:24:15 +0000
(
04:24
+0100)
committer
Bert Vermeulen
<bert@biot.com>
Sun, 15 Jan 2012 03:24:15 +0000
(
04:24
+0100)
decoder.c
patch
|
blob
|
history
diff --git
a/decoder.c
b/decoder.c
index 6b5fc95f0fadbef2bc0636618121b82516555181..dde067ee45eb9520aa3f6c0a846ec8ac885d02da 100644
(file)
--- a/
decoder.c
+++ b/
decoder.c
@@
-193,10
+193,21
@@
err_out:
char *srd_decoder_doc(struct srd_decoder *dec)
{
+ PyObject *py_str;
char *doc;
+ if (!PyObject_HasAttrString(dec->py_mod, "__doc__"))
+ return NULL;
+
+ if (!(py_str = PyObject_GetAttrString(dec->py_mod, "__doc__"))) {
+ PyErr_Clear();
+ return NULL;
+ }
+
doc = NULL;
- py_attr_as_str(dec->py_mod, "__doc__", &doc);
+ if (py_str != Py_None)
+ py_str_as_str(py_str, &doc);
+ Py_DecRef(py_str);
return doc;
}