Changeset 16685

Show
Ignore:
Timestamp:
06/23/08 20:03:36 (3 months ago)
Author:
piotras
Message:

get_attr: Do generic getattr fallback when object's attribute is not found

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/midgard/apis/python/py_midgard_object.c

    r16678 r16685  
    608608 
    609609        if(!pspec) { 
    610                  
    611                 PyErr_Format(PyExc_AttributeError, 
    612                                 "'%.50s' object has no attribute '%.400s'", 
    613                                 tp->tp_name, attr_name); 
    614                 return NULL; 
     610 
     611                /* Try Generic Fallback once again */ 
     612                return PyObject_GenericGetAttr(self, attr);              
    615613        } 
    616614 
     
    741739                PyTypeObject *ot = __new_object_struct(typename); 
    742740                pygobject_register_class(d, 
    743                                 typename, all_types[i], ot,  
     741                                typename, all_types[i], ot,  
    744742                                /* FIXME, What is a static bases in this case? */ 
    745743                                Py_BuildValue("(O)", pygobject_type));