Blender Git Commit Log

Git Commits -> Revision dd36c6b

Revision dd36c6b by Lukas Toenne (master)
August 23, 2013, 15:39 (GMT)
Fix for an obscure bpy_types bug: When attempting to define __setattr__ in a metaclass based on RNAMetaPropGroup, the base class' __setattr__ method can not be called, since python prohibits setattr on
builtin classes. This was done in Python 2.3 to prevent changes to the 'object' type definition and similar issues. As explained by Guido van Rossum in the following mail, the python check will look for
the *closest* base class, which fails for RNAMetaPropGroup because its first base is RNAMeta, which is in turn a subclass of 'type'.

http://code.activestate.com/lists/python-dev/34489/

The easiest and safest way to prevent this issue therefore seems to be
to swap the base class order for RNAMetaPropGroup, so that StructMetaPropGroup is the first base, which has a perfectly valid setattr implementation.

Commit Details:

Full Hash: dd36c6b948892f1d79ab058d5ca4a0b817a3e104
SVN Revision: 59430
Parent Commit: 6f26acb
Lines Changed: +1, -1

1 Modified Path:

/release/scripts/modules/bpy_types.py (+1, -1) (Diff)
By: Miika HämäläinenLast update: Nov-07-2014 14:18MiikaHweb | 2003-2021