From 442bad1f50cc8dea49f3c3de8add55723f9cf1e4 Mon Sep 17 00:00:00 2001 From: Thomas A Caswell Date: Sat, 30 Apr 2022 16:48:26 -0400 Subject: [PATCH 1/2] MNT: ignore vscode files --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 6dad5718..8a40c93c 100644 --- a/.gitignore +++ b/.gitignore @@ -12,3 +12,4 @@ __pycache__/ /.ropeproject/ /MANIFEST benchmarks/*.json +.vscode From 9fe87462569a0d3f27364d93df3934ecbb8fe585 Mon Sep 17 00:00:00 2001 From: Thomas A Caswell Date: Sat, 30 Apr 2022 16:48:48 -0400 Subject: [PATCH 2/2] MNT: explicitly cast away const-ness when calling CPython API --- src/greenlet/greenlet_refs.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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))); }