+ in setPyObject() only use classes derived from Base::Exception
This commit is contained in:
@@ -113,7 +113,7 @@ void PropertyFemMesh::setPyObject(PyObject *value)
|
||||
else {
|
||||
std::string error = std::string("type must be 'FemMesh', not ");
|
||||
error += value->ob_type->tp_name;
|
||||
throw Py::TypeError(error);
|
||||
throw Base::TypeError(error);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -261,7 +261,7 @@ PyObject* PropertyCurvatureList::getPyObject(void)
|
||||
|
||||
void PropertyCurvatureList::setPyObject(PyObject *value)
|
||||
{
|
||||
throw Py::AttributeError(std::string("This attribute is read-only"));
|
||||
throw Base::AttributeError(std::string("This attribute is read-only"));
|
||||
}
|
||||
|
||||
App::Property *PropertyCurvatureList::Copy(void) const
|
||||
@@ -430,7 +430,7 @@ void PropertyMeshKernel::setPyObject(PyObject *value)
|
||||
else {
|
||||
std::string error = std::string("type must be 'Mesh', not ");
|
||||
error += value->ob_type->tp_name;
|
||||
throw Py::TypeError(error);
|
||||
throw Base::TypeError(error);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -123,7 +123,7 @@ void PropertyGeometryList::setPyObject(PyObject *value)
|
||||
if (!PyObject_TypeCheck(item, &(GeometryPy::Type))) {
|
||||
std::string error = std::string("types in list must be 'Geometry', not ");
|
||||
error += item->ob_type->tp_name;
|
||||
throw Py::TypeError(error);
|
||||
throw Base::TypeError(error);
|
||||
}
|
||||
|
||||
values[i] = static_cast<GeometryPy*>(item)->getGeometryPtr();
|
||||
@@ -138,7 +138,7 @@ void PropertyGeometryList::setPyObject(PyObject *value)
|
||||
else {
|
||||
std::string error = std::string("type must be 'Geometry' or list of 'Geometry', not ");
|
||||
error += value->ob_type->tp_name;
|
||||
throw Py::TypeError(error);
|
||||
throw Base::TypeError(error);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -200,7 +200,7 @@ void PropertyPartShape::setPyObject(PyObject *value)
|
||||
else {
|
||||
std::string error = std::string("type must be 'Shape', not ");
|
||||
error += value->ob_type->tp_name;
|
||||
throw Py::TypeError(error);
|
||||
throw Base::TypeError(error);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -99,7 +99,7 @@ void PropertyPointKernel::setPyObject(PyObject *value)
|
||||
else {
|
||||
std::string error = std::string("type must be 'Points', not ");
|
||||
error += value->ob_type->tp_name;
|
||||
throw Py::TypeError(error);
|
||||
throw Base::TypeError(error);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -106,7 +106,7 @@ void PropertyTrajectory::setPyObject(PyObject *value)
|
||||
else {
|
||||
std::string error = std::string("type must be 'Trajectory', not ");
|
||||
error += value->ob_type->tp_name;
|
||||
throw Py::TypeError(error);
|
||||
throw Base::TypeError(error);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -126,7 +126,7 @@ void PropertyConstraintList::setPyObject(PyObject *value)
|
||||
if (!PyObject_TypeCheck(item, &(ConstraintPy::Type))) {
|
||||
std::string error = std::string("types in list must be 'Constraint', not ");
|
||||
error += item->ob_type->tp_name;
|
||||
throw Py::TypeError(error);
|
||||
throw Base::TypeError(error);
|
||||
}
|
||||
|
||||
values[i] = static_cast<ConstraintPy*>(item)->getConstraintPtr();
|
||||
@@ -141,7 +141,7 @@ void PropertyConstraintList::setPyObject(PyObject *value)
|
||||
else {
|
||||
std::string error = std::string("type must be 'Constraint' or list of 'Constraint', not ");
|
||||
error += value->ob_type->tp_name;
|
||||
throw Py::TypeError(error);
|
||||
throw Base::TypeError(error);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user