diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-09-13 17:29:54 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-09-13 17:29:54 +0400 |
commit | 55f7451c523fab2a7f3e83c3eaaeeb5a803a3aef (patch) | |
tree | 9c036cdea39897d316a8b485397f585d66d6c72c /release/scripts | |
parent | ba2a9ae88ec3dd70bfd9ed7099789d0d5befe407 (diff) |
fix for sphinx doc generation
Diffstat (limited to 'release/scripts')
-rw-r--r-- | release/scripts/modules/bpy_types.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/release/scripts/modules/bpy_types.py b/release/scripts/modules/bpy_types.py index 58a339d79c1..0364496dd44 100644 --- a/release/scripts/modules/bpy_types.py +++ b/release/scripts/modules/bpy_types.py @@ -635,24 +635,28 @@ class OrderedMeta(RNAMeta): # Only defined so operators members can be used by accessing self.order +# with doc generation 'self.properties.bl_rna.properties' can fail class Operator(StructRNA, metaclass=OrderedMeta): __slots__ = () def __getattribute__(self, attr): properties = StructRNA.path_resolve(self, "properties") - if attr in properties.bl_rna.properties: + bl_rna = getattr(properties, "bl_rna", None) + if bl_rna and attr in bl_rna.properties: return getattr(properties, attr) return super().__getattribute__(attr) def __setattr__(self, attr, value): properties = StructRNA.path_resolve(self, "properties") - if attr in properties.bl_rna.properties: + bl_rna = getattr(properties, "bl_rna", None) + if bl_rna and attr in bl_rna.properties: setattr(properties, attr, value) return super().__setattr__(attr, value) def __delattr__(self, attr): properties = StructRNA.path_resolve(self, "properties") - if attr in properties.bl_rna.properties: + bl_rna = getattr(properties, "bl_rna", None) + if bl_rna and attr in bl_rna.properties: delattr(properties, attr) return super().__delattr__(attr) |