python: use const_cast<> to new() python types.
This commit is contained in:
@@ -1362,7 +1362,7 @@ PyObject* TopoShapePy::reversed(PyObject *args) const
|
||||
|
||||
// let the type object decide
|
||||
if (type->tp_new)
|
||||
cpy = type->tp_new(type, this, nullptr);
|
||||
cpy = type->tp_new(type, const_cast<TopoShapePy*>(this), nullptr);
|
||||
if (!cpy) {
|
||||
PyErr_SetString(PyExc_TypeError, "failed to create copy of shape");
|
||||
return nullptr;
|
||||
@@ -2342,7 +2342,7 @@ PyObject* TopoShapePy::defeaturing(PyObject *args) const
|
||||
);
|
||||
}
|
||||
PyTypeObject* type = this->GetType();
|
||||
PyObject* inst = type->tp_new(type, this, nullptr);
|
||||
PyObject* inst = type->tp_new(type, const_cast<TopoShapePy*>(this), nullptr);
|
||||
static_cast<TopoShapePy*>(inst)->getTopoShapePtr()->setShape
|
||||
(this->getTopoShapePtr()->defeaturing(shapes));
|
||||
return inst;
|
||||
|
||||
Reference in New Issue
Block a user