mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
Make CObjects mutable. Fixes #477441.
This commit is contained in:
parent
95cf84a4f3
commit
01a74b2fa1
4 changed files with 30 additions and 5 deletions
|
@ -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)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue