diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-06-09 23:44:06 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-06-09 23:44:06 +0400 |
commit | 006d5e82e8494ef19759f28d92088ebc27dedd3d (patch) | |
tree | a60bfbf69a1f9c4a7ec84c92dc0609b88bfebb74 /release | |
parent | dd72ffe3ff6871960f644d6c4b16c1661c7b4e03 (diff) |
more cleanup to bpy.context.copy(), exclude rna values and its self.
Diffstat (limited to 'release')
-rw-r--r-- | release/scripts/modules/bpy_types.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/release/scripts/modules/bpy_types.py b/release/scripts/modules/bpy_types.py index c8153ce9b74..0ba36a7c092 100644 --- a/release/scripts/modules/bpy_types.py +++ b/release/scripts/modules/bpy_types.py @@ -29,14 +29,14 @@ class Context(StructRNA): __slots__ = () def copy(self): - import types + from types import BuiltinMethodType new_context = {} - generic_keys = StructRNA.__dict__.keys() - for item in dir(self): - if item not in generic_keys: - value = getattr(self, item) - if type(value) != types.BuiltinMethodType: - new_context[item] = getattr(self, item) + generic_attrs = list(StructRNA.__dict__.keys()) + ["bl_rna", "rna_type", "copy"] + for attr in dir(self): + if not (attr.startswith("_") or attr in generic_attrs): + value = getattr(self, attr) + if type(value) != BuiltinMethodType: + new_context[attr] = value return new_context |