Just a reply to one part of your message, as I really need to get back to work for now. Antoine Pitrou wrote: > I think solution #1 would be the best one. > #2 looks too complicated. > #2 is a seven-line diff, below. /larry/ Index: cobject.c =================================================================== --- cobject.c (revision 79396) +++ cobject.c (working copy) @@ -50,7 +50,12 @@ PyCObject_AsVoidPtr(PyObject *self) { if (self) { - if (self->ob_type == &PyCObject_Type) + if (PyCapsule_CheckExact(self)) { + const char *name = PyCapsule_GetName(self); + const void *value = PyCapsule_GetPointer(self, name); + return value; + } + else if (self->ob_type == &PyCObject_Type) return ((PyCObject *)self)->cobject; PyErr_SetString(PyExc_TypeError, "PyCObject_AsVoidPtr with non-C-object");
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4