Skip to content

Commit 9fe8746

Browse files
committed
MNT: explicitly cast away const-ness when calling CPython API
1 parent 442bad1 commit 9fe8746

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/greenlet/greenlet_refs.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ namespace greenlet {
339339
Py_XINCREF(other.p);
340340
const T* tmp = this->p;
341341
this->p = other.p;
342-
Py_XDECREF(tmp);
342+
Py_XDECREF(const_cast<T*>(tmp));
343343
return *this;
344344
}
345345

@@ -851,7 +851,7 @@ namespace greenlet {
851851

852852
void PyAddObject(const char* name, const PyObject* new_object)
853853
{
854-
Py_INCREF(new_object);
854+
Py_INCREF(const_cast<PyObject*>(new_object));
855855
try {
856856
Require(PyModule_AddObject(this->p, name, const_cast<PyObject*>(new_object)));
857857
}

0 commit comments

Comments
 (0)