fix own error [#26522] Api autocomplete return many errors
authorCampbell Barton <ideasman42@gmail.com>
Wed, 16 Mar 2011 21:58:45 +0000 (21:58 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Wed, 16 Mar 2011 21:58:45 +0000 (21:58 +0000)
collections were getting __call__ attribute from the StructRNA, now ignore all starting with '_'

source/blender/python/intern/bpy_rna.c

index 5d4a4993f390c5adc099eca94da87127189e3d3e..36e636dc11d5f445882dce10f8f7224e361620da 100644 (file)
@@ -3144,7 +3144,7 @@ static PyObject *pyrna_prop_collection_getattro(BPy_PropertyRNA *self, PyObject
 
                PyObject *ret= PyObject_GenericGetAttr((PyObject *)self, pyname);
 
-               if(ret == NULL) {
+               if(ret == NULL && name[0] != '_') { /* avoid inheriting __call__ and similar */
                        /* since this is least common case, handle it last */
                        PointerRNA r_ptr;
                        if(RNA_property_collection_type_get(&self->ptr, self->prop, &r_ptr)) {