[Python-checkins] python/dist/src/Objects cobject.c,2.15,2.16

loewis at users.sourceforge.net loewis at users.sourceforge.net
Sun Oct 19 14:30:03 EDT 2003


Update of /cvsroot/python/python/dist/src/Objects
In directory sc8-pr-cvs1:/tmp/cvs-serv29267/Objects

Modified Files:
	cobject.c 
Log Message:
Make CObjects mutable. Fixes #477441.


Index: cobject.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Objects/cobject.c,v
retrieving revision 2.15
retrieving revision 2.16
diff -C2 -d -r2.15 -r2.16
*** cobject.c	11 Jul 2003 17:02:39 -0000	2.15
--- cobject.c	19 Oct 2003 18:30:01 -0000	2.16
***************
*** 100,103 ****
--- 100,117 ----
  }
  
+ 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)





More information about the Python-checkins mailing list