summaryrefslogtreecommitdiffstats
path: root/src/PluginAlgorithm.cpp
diff options
context:
space:
mode:
authorDaniel M. Pelt <D.M.Pelt@cwi.nl>2015-08-05 16:26:01 +0200
committerDaniel M. Pelt <D.M.Pelt@cwi.nl>2015-08-05 16:26:01 +0200
commitab980d9f088c0f4e28d61b94c32788c30a9c4cb9 (patch)
treeb24617bdfffa83aab4a9f1f5765d4313267d516c /src/PluginAlgorithm.cpp
parentdb8587475efd44bc728caa79cd7ae7120eaf045b (diff)
downloadastra-ab980d9f088c0f4e28d61b94c32788c30a9c4cb9.tar.gz
astra-ab980d9f088c0f4e28d61b94c32788c30a9c4cb9.tar.bz2
astra-ab980d9f088c0f4e28d61b94c32788c30a9c4cb9.tar.xz
astra-ab980d9f088c0f4e28d61b94c32788c30a9c4cb9.zip
Fix get_help for classes without docstring
Diffstat (limited to 'src/PluginAlgorithm.cpp')
-rw-r--r--src/PluginAlgorithm.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/PluginAlgorithm.cpp b/src/PluginAlgorithm.cpp
index 5d6d733..4066e30 100644
--- a/src/PluginAlgorithm.cpp
+++ b/src/PluginAlgorithm.cpp
@@ -290,12 +290,14 @@ std::string CPluginAlgorithmFactory::getHelp(std::string name){
if(inspect!=NULL && six!=NULL){
PyObject *retVal = PyObject_CallMethod(inspect,"getdoc","O",pyclass);
if(retVal!=NULL){
- PyObject *retb = PyObject_CallMethod(six,"b","O",retVal);
- Py_DECREF(retVal);
- if(retb!=NULL){
- ret = std::string(PyBytes_AsString(retb));
- Py_DECREF(retb);
+ if(retVal!=Py_None){
+ PyObject *retb = PyObject_CallMethod(six,"b","O",retVal);
+ if(retb!=NULL){
+ ret = std::string(PyBytes_AsString(retb));
+ Py_DECREF(retb);
+ }
}
+ Py_DECREF(retVal);
}else{
logPythonError();
}