summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/PluginAlgorithm.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/PluginAlgorithm.cpp b/src/PluginAlgorithm.cpp
index a118f54..d6cf731 100644
--- a/src/PluginAlgorithm.cpp
+++ b/src/PluginAlgorithm.cpp
@@ -173,13 +173,19 @@ PyObject * getClassFromString(std::string str){
std::vector<std::string> items;
boost::split(items, str, boost::is_any_of("."));
PyObject *pyclass = PyImport_ImportModule(items[0].c_str());
- if(pyclass==NULL) return NULL;
+ if(pyclass==NULL){
+ logPythonError();
+ return NULL;
+ }
PyObject *submod = pyclass;
for(unsigned int i=1;i<items.size();i++){
submod = PyObject_GetAttrString(submod,items[i].c_str());
Py_DECREF(pyclass);
pyclass = submod;
- if(pyclass==NULL) return NULL;
+ if(pyclass==NULL){
+ logPythonError();
+ return NULL;
+ }
}
return pyclass;
}
@@ -194,8 +200,6 @@ CPluginAlgorithm * CPluginAlgorithmFactory::getPlugin(std::string name){
if(pyclass!=NULL){
alg = new CPluginAlgorithm(pyclass);
Py_DECREF(pyclass);
- }else{
- logPythonError();
}
}else{
alg = new CPluginAlgorithm(className);