Make CObjects mutable. Fixes #477441.

This commit is contained in:
Martin v. Löwis 2003-10-19 18:30:01 +00:00
parent 95cf84a4f3
commit 01a74b2fa1
4 changed files with 30 additions and 5 deletions

View file

@ -99,6 +99,20 @@ PyCObject_Import(char *module_name, char *name)
return r;
}
int
PyCObject_SetVoidPtr(PyObject *_self, void *cobj)
{
PyCObject* self = (PyCObject*)_self;
if (self == NULL || !PyCObject_Check(self) ||
self->destructor != NULL) {
PyErr_SetString(PyExc_TypeError,
"Invalid call to PyCObject_SetVoidPtr");
return 0;
}
self->cobject = cobj;
return 1;
}
static void
PyCObject_dealloc(PyCObject *self)
{