Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2013-06-13 15:35:25 +0400
committerCampbell Barton <ideasman42@gmail.com>2013-06-13 15:35:25 +0400
commit65047099b2618d67b2e78e71318fdff4e7c3af16 (patch)
treef1771a055c906544808112d15a6782ec1f1491f2 /source/blender/python
parentd958144b65599a8ffef14c39addee109fc4427f9 (diff)
fix for pythons __dir__ returning registrable functions on class instances (which may not have the functions defined).
gave odd behavior of including members in __dir__ that couldn't getattr()
Diffstat (limited to 'source/blender/python')
-rw-r--r--source/blender/python/intern/bpy_rna.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c
index 53340437e07..76e64ebba6e 100644
--- a/source/blender/python/intern/bpy_rna.c
+++ b/source/blender/python/intern/bpy_rna.c
@@ -3425,11 +3425,14 @@ static void pyrna_dir_members_rna(PyObject *list, PointerRNA *ptr)
RNA_PROP_BEGIN (&tptr, itemptr, iterprop)
{
- idname = RNA_function_identifier(itemptr.data);
+ FunctionRNA *func = itemptr.data;
+ if (RNA_function_defined(func)) {
+ idname = RNA_function_identifier(itemptr.data);
- pystring = PyUnicode_FromString(idname);
- PyList_Append(list, pystring);
- Py_DECREF(pystring);
+ pystring = PyUnicode_FromString(idname);
+ PyList_Append(list, pystring);
+ Py_DECREF(pystring);
+ }
}
RNA_PROP_END;
}