Fix assigning to PropertyLinkSub via Python
This commit is contained in:
parent
3c50de4334
commit
d477ce66af
|
@ -254,12 +254,17 @@ void PropertyLinkSub::setPyObject(PyObject *value)
|
||||||
|
|
||||||
setValue(pcObj->getDocumentObjectPtr(),vals);
|
setValue(pcObj->getDocumentObjectPtr(),vals);
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
std::string error = std::string("type of first element in tuple must be 'DocumentObject', not ");
|
||||||
|
error += tup[0].ptr()->ob_type->tp_name;
|
||||||
|
throw Py::TypeError(error);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if(Py_None == value) {
|
else if(Py_None == value) {
|
||||||
setValue(0);
|
setValue(0);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
std::string error = std::string("type must be 'DocumentObject', 'NoneType' of ('DocumentObject',['String',]) not ");
|
std::string error = std::string("type must be 'DocumentObject', 'NoneType' or ('DocumentObject',['String',]) not ");
|
||||||
error += value->ob_type->tp_name;
|
error += value->ob_type->tp_name;
|
||||||
throw Py::TypeError(error);
|
throw Py::TypeError(error);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user