Set parameters working
This commit is contained in:
@@ -5,7 +5,7 @@ namespace pywrap {
|
|||||||
namespace np = boost::python::numpy;
|
namespace np = boost::python::numpy;
|
||||||
PyClassifier::PyClassifier(const std::string& module, const std::string& className) : module(module), className(className), fitted(false)
|
PyClassifier::PyClassifier(const std::string& module, const std::string& className) : module(module), className(className), fitted(false)
|
||||||
{
|
{
|
||||||
id = reinterpret_cast<uint32_t>(&this);
|
id = 0;//reinterpret_cast<uint32_t>(&this);
|
||||||
pyWrap = PyWrap::GetInstance();
|
pyWrap = PyWrap::GetInstance();
|
||||||
pyWrap->importClass(module, className);
|
pyWrap->importClass(module, className);
|
||||||
}
|
}
|
||||||
|
@@ -133,7 +133,7 @@ namespace pywrap {
|
|||||||
}
|
}
|
||||||
int res = PyObject_SetAttrString(instance, key.c_str(), pValue);
|
int res = PyObject_SetAttrString(instance, key.c_str(), pValue);
|
||||||
if (res == -1 && PyErr_Occurred()) {
|
if (res == -1 && PyErr_Occurred()) {
|
||||||
cleanDictionary(args);
|
Py_XDECREF(pValue);
|
||||||
errorAbort("Couldn't set attribute " + key + "=" + value.dump());
|
errorAbort("Couldn't set attribute " + key + "=" + value.dump());
|
||||||
}
|
}
|
||||||
Py_XDECREF(pValue);
|
Py_XDECREF(pValue);
|
||||||
|
Reference in New Issue
Block a user