Ignore:
Timestamp:
Mar 19, 2014, 11:31:01 PM (11 years ago)
Author:
dmik
Message:

python: Merge vendor 2.7.6 to trunk.

Location:
python/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • python/trunk

  • python/trunk/Objects/cobject.c

    r2 r391  
    1010typedef void (*destructor2)(void *, void*);
    1111
     12static 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
    1219PyObject *
    1320PyCObject_FromVoidPtr(void *cobj, void (*destr)(void *))
    1421{
    1522    PyCObject *self;
     23
     24    if (cobject_deprecation_warning()) {
     25        return NULL;
     26    }
    1627
    1728    self = PyObject_NEW(PyCObject, &PyCObject_Type);
     
    3041{
    3142    PyCObject *self;
     43
     44    if (cobject_deprecation_warning()) {
     45        return NULL;
     46    }
    3247
    3348    if (!desc) {
     
    5166{
    5267    if (self) {
     68        if (PyCapsule_CheckExact(self)) {
     69            const char *name = PyCapsule_GetName(self);
     70            return (void *)PyCapsule_GetPointer(self, name);
     71        }
    5372        if (self->ob_type == &PyCObject_Type)
    5473            return ((PyCObject *)self)->cobject;
Note: See TracChangeset for help on using the changeset viewer.