[Bf-blender-cvs] [2e01f38] master: Python API: fix for help() failing on bpy instances

Campbell Barton noreply at git.blender.org
Mon Jan 20 08:16:41 CET 2014


Commit: 2e01f38885906bc14cb5a50cfe474aa562929ef3
Author: Campbell Barton
Date:   Mon Jan 20 18:13:15 2014 +1100
https://developer.blender.org/rB2e01f38885906bc14cb5a50cfe474aa562929ef3

Python API: fix for help() failing on bpy instances

Caused by missing __name__ from bpy.types (alternate method to patch D232)

===================================================================

M	source/blender/python/intern/bpy_rna.c

===================================================================

diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c
index 86ed459..16cedcc 100644
--- a/source/blender/python/intern/bpy_rna.c
+++ b/source/blender/python/intern/bpy_rna.c
@@ -6653,6 +6653,11 @@ PyObject *BPY_rna_types(void)
 			return NULL;
 	}
 
+	/* static members for the base class */
+	/* add __name__ since help() expects its */
+	PyDict_SetItem(pyrna_basetype_Type.tp_dict, bpy_intern_str___name__, bpy_intern_str_bpy_types);
+
+
 	self = (BPy_BaseTypeRNA *)PyObject_NEW(BPy_BaseTypeRNA, &pyrna_basetype_Type);
 
 	/* avoid doing this lookup for every getattr */




More information about the Bf-blender-cvs mailing list