python: use const_cast<> to new() python types.

This commit is contained in:
Jacob Oursland
2025-04-16 20:31:15 -07:00
parent 5c251e73ac
commit 0b29aa596a
9 changed files with 14 additions and 14 deletions

View File

@@ -161,7 +161,7 @@ PyObject* Geometry2dPy::copy(PyObject *args) const
PyObject* cpy = nullptr;
// let the type object decide
if (type->tp_new)
cpy = type->tp_new(type, this, nullptr);
cpy = type->tp_new(type, const_cast<Geometry2dPy*>(this), nullptr);
if (!cpy) {
PyErr_SetString(PyExc_TypeError, "failed to create copy of geometry");
return nullptr;