raise exception in PropertyLinkSubList::setPyObject for wrong type

This commit is contained in:
wmayer
2018-01-18 15:53:51 +01:00
parent a332feb2c6
commit fd8562bce2

View File

@@ -996,6 +996,11 @@ void PropertyLinkSubList::setPyObject(PyObject *value)
values.insert(values.end(), list.size(), pcObj->getDocumentObjectPtr());
}
}
else {
std::string error = std::string("type of first item must be 'DocumentObject', not ");
error += Py_TYPE(tup[0].ptr())->tp_name;
throw Base::TypeError(error);
}
}
else if (PyObject_TypeCheck(*item, &(DocumentObjectPy::Type))) {
DocumentObjectPy *pcObj;