Skip to content

Commit

Permalink
MNT: explicitly cast away const-ness when calling CPython API
Browse files Browse the repository at this point in the history
  • Loading branch information
tacaswell committed Apr 30, 2022
1 parent 442bad1 commit 9fe8746
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/greenlet/greenlet_refs.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ namespace greenlet {
Py_XINCREF(other.p);
const T* tmp = this->p;
this->p = other.p;
Py_XDECREF(tmp);
Py_XDECREF(const_cast<T*>(tmp));
return *this;
}

Expand Down Expand Up @@ -851,7 +851,7 @@ namespace greenlet {

void PyAddObject(const char* name, const PyObject* new_object)
{
Py_INCREF(new_object);
Py_INCREF(const_cast<PyObject*>(new_object));
try {
Require(PyModule_AddObject(this->p, name, const_cast<PyObject*>(new_object)));
}
Expand Down

0 comments on commit 9fe8746

Please sign in to comment.