Changeset 388 for python/vendor/current/Objects/cobject.c
- Timestamp:
- Mar 19, 2014, 11:11:30 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
python/vendor/current/Objects/cobject.c
r2 r388 10 10 typedef void (*destructor2)(void *, void*); 11 11 12 static int cobject_deprecation_warning(void) 13 { 14 return PyErr_WarnPy3k("CObject type is not supported in 3.x. " 15 "Please use capsule objects instead.", 1); 16 } 17 18 12 19 PyObject * 13 20 PyCObject_FromVoidPtr(void *cobj, void (*destr)(void *)) 14 21 { 15 22 PyCObject *self; 23 24 if (cobject_deprecation_warning()) { 25 return NULL; 26 } 16 27 17 28 self = PyObject_NEW(PyCObject, &PyCObject_Type); … … 30 41 { 31 42 PyCObject *self; 43 44 if (cobject_deprecation_warning()) { 45 return NULL; 46 } 32 47 33 48 if (!desc) { … … 51 66 { 52 67 if (self) { 68 if (PyCapsule_CheckExact(self)) { 69 const char *name = PyCapsule_GetName(self); 70 return (void *)PyCapsule_GetPointer(self, name); 71 } 53 72 if (self->ob_type == &PyCObject_Type) 54 73 return ((PyCObject *)self)->cobject;
Note:
See TracChangeset
for help on using the changeset viewer.