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()
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user