Modify PropertyLinkList to accept None from Python.
This commit is contained in:
@@ -716,8 +716,10 @@ PyObject *PropertyLinkList::getPyObject(void)
|
||||
}
|
||||
|
||||
DocumentObject *PropertyLinkList::getPyValue(PyObject *item) const {
|
||||
if (!PyObject_TypeCheck(item, &(DocumentObjectPy::Type))) {
|
||||
std::string error = std::string("type must be 'DocumentObject' or list of 'DocumentObject', not ");
|
||||
if (item == Py_None) {
|
||||
return nullptr;
|
||||
} else if (!PyObject_TypeCheck(item, &(DocumentObjectPy::Type))) {
|
||||
std::string error = std::string("type must be 'DocumentObject', list of 'DocumentObject', or NoneType, not ");
|
||||
error += item->ob_type->tp_name;
|
||||
throw Base::TypeError(error);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user