diff options
| author | Daniel M. Pelt <D.M.Pelt@cwi.nl> | 2015-08-05 16:26:01 +0200 | 
|---|---|---|
| committer | Daniel M. Pelt <D.M.Pelt@cwi.nl> | 2015-08-05 16:26:01 +0200 | 
| commit | ab980d9f088c0f4e28d61b94c32788c30a9c4cb9 (patch) | |
| tree | b24617bdfffa83aab4a9f1f5765d4313267d516c /src | |
| parent | db8587475efd44bc728caa79cd7ae7120eaf045b (diff) | |
| download | astra-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')
| -rw-r--r-- | src/PluginAlgorithm.cpp | 12 | 
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();          } | 
