diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-06-13 15:35:25 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-06-13 15:35:25 +0400 |
commit | 65047099b2618d67b2e78e71318fdff4e7c3af16 (patch) | |
tree | f1771a055c906544808112d15a6782ec1f1491f2 /source/blender | |
parent | d958144b65599a8ffef14c39addee109fc4427f9 (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')
-rw-r--r-- | source/blender/python/intern/bpy_rna.c | 11 |
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; } |