more cleanup to bpy.context.copy(), exclude rna values and its self.

This commit is contained in:
Campbell Barton 2010-06-09 19:44:06 +00:00
parent dd72ffe3ff
commit 006d5e82e8

@ -29,14 +29,14 @@ class Context(StructRNA):
__slots__ = () __slots__ = ()
def copy(self): def copy(self):
import types from types import BuiltinMethodType
new_context = {} new_context = {}
generic_keys = StructRNA.__dict__.keys() generic_attrs = list(StructRNA.__dict__.keys()) + ["bl_rna", "rna_type", "copy"]
for item in dir(self): for attr in dir(self):
if item not in generic_keys: if not (attr.startswith("_") or attr in generic_attrs):
value = getattr(self, item) value = getattr(self, attr)
if type(value) != types.BuiltinMethodType: if type(value) != BuiltinMethodType:
new_context[item] = getattr(self, item) new_context[attr] = value
return new_context return new_context