py api: minor change to operator attribute access, do identity comparison with None (no functional change).

This commit is contained in:
Campbell Barton
2013-04-11 10:16:18 +00:00
parent bf77ad00b3
commit 2c6a82dd0a

View File

@@ -555,21 +555,21 @@ class Operator(StructRNA, metaclass=OrderedMeta):
def __getattribute__(self, attr):
properties = StructRNA.path_resolve(self, "properties")
bl_rna = getattr(properties, "bl_rna", None)
if bl_rna and attr in bl_rna.properties:
if (bl_rna is not None) 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")
bl_rna = getattr(properties, "bl_rna", None)
if bl_rna and attr in bl_rna.properties:
if (bl_rna is not None) and (attr in bl_rna.properties):
return setattr(properties, attr, value)
return super().__setattr__(attr, value)
def __delattr__(self, attr):
properties = StructRNA.path_resolve(self, "properties")
bl_rna = getattr(properties, "bl_rna", None)
if bl_rna and attr in bl_rna.properties:
if (bl_rna is not None) and (attr in bl_rna.properties):
return delattr(properties, attr)
return super().__delattr__(attr)