Fix nan issue in features
[trackerpp.git] / src / PredictorWrapper.cpp
index 5559ddc..77d99af 100644 (file)
@@ -29,6 +29,7 @@ boost::python::list toPythonList(const std::vector<T>& v) {
         ret_val = py::extract<decltype(ret_val)>(py_ret);       \
     }catch(boost::python::error_already_set const &){           \
         LOG_ERROR(TAG, PyWrapper::parse_python_exception());    \
+        throw runtime_error("Python error");                    \
     }                                                           \
 
 
@@ -46,9 +47,9 @@ bool PredictorWrapper::load(const string& fname)
 {
     LOG_DEBUG(TAG, "load " + fname);
     py::object func = m_module.attr("init");
-    string ret;
+    bool ret = true;
     CALL_WITH_EXCEPTION(func(fname.c_str()), ret);
-    return true;
+    return ret;
 }
 
 void PredictorWrapper::dump()