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:
authorCampbell Barton <ideasman42@gmail.com>2010-06-09 23:44:06 +0400
committerCampbell Barton <ideasman42@gmail.com>2010-06-09 23:44:06 +0400
commit006d5e82e8494ef19759f28d92088ebc27dedd3d (patch)
treea60bfbf69a1f9c4a7ec84c92dc0609b88bfebb74 /release
parentdd72ffe3ff6871960f644d6c4b16c1661c7b4e03 (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.py14
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