parents of Call/Array are now also weakrefs

This commit is contained in:
David Halter
2012-08-13 12:17:28 +02:00
parent bc6cf350c2
commit e6f6003476
2 changed files with 20 additions and 20 deletions

View File

@@ -68,10 +68,11 @@ def fast_parent_copy(obj):
def recursion(obj):
new_obj = copy.copy(obj)
new_elements[obj] = new_obj
try:
new_obj.parent = new_elements[obj.parent]
except KeyError:
pass
if obj.parent is not None:
try:
new_obj.parent = weakref.ref(new_elements[obj.parent()])
except KeyError:
pass
#print new_obj.__dict__
for key, value in new_obj.__dict__.items():