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:
authorLukas Toenne <lukas.toenne@googlemail.com>2013-08-23 19:39:25 +0400
committerLukas Toenne <lukas.toenne@googlemail.com>2013-08-23 19:39:25 +0400
commitdd36c6b948892f1d79ab058d5ca4a0b817a3e104 (patch)
tree266baf2f9beb0c1e1202d6d7498287518f80fff0 /release/scripts/modules/bpy_types.py
parent6f26acb00934594859cca09e9774b41a6c1a9e7c (diff)
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.
Diffstat (limited to 'release/scripts/modules/bpy_types.py')
-rw-r--r--release/scripts/modules/bpy_types.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/release/scripts/modules/bpy_types.py b/release/scripts/modules/bpy_types.py
index d3ac5a6093c..f8870cbe705 100644
--- a/release/scripts/modules/bpy_types.py
+++ b/release/scripts/modules/bpy_types.py
@@ -547,7 +547,7 @@ class OrderedDictMini(dict):
self.order.remove(key)
-class RNAMetaPropGroup(RNAMeta, StructMetaPropGroup):
+class RNAMetaPropGroup(StructMetaPropGroup, RNAMeta):
pass