diff --git a/.gitignore b/.gitignore index 6dad5718..8a40c93c 100644 --- a/.gitignore +++ b/.gitignore @@ -12,3 +12,4 @@ __pycache__/ /.ropeproject/ /MANIFEST benchmarks/*.json +.vscode diff --git a/src/greenlet/greenlet_refs.hpp b/src/greenlet/greenlet_refs.hpp index d109229b..7cf741ea 100644 --- a/src/greenlet/greenlet_refs.hpp +++ b/src/greenlet/greenlet_refs.hpp @@ -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(tmp)); return *this; } @@ -851,7 +851,7 @@ namespace greenlet { void PyAddObject(const char* name, const PyObject* new_object) { - Py_INCREF(new_object); + Py_INCREF(const_cast(new_object)); try { Require(PyModule_AddObject(this->p, name, const_cast(new_object))); }