weakrefs also for parent_stmt

This commit is contained in:
David Halter
2012-08-13 11:38:54 +02:00
parent 8e20c754b1
commit bc6cf350c2
5 changed files with 25 additions and 17 deletions

View File

@@ -781,16 +781,16 @@ class Call(object):
self.next = None
self.execution = None
self._parent_stmt = parent_stmt
self._parent_stmt = weakref.ref(parent_stmt) if parent_stmt else None
@property
def parent_stmt(self):
if self._parent_stmt:
if self._parent_stmt is not None:
return self._parent_stmt
elif self.parent:
return self.parent.parent_stmt
else:
return None
return lambda: None
@parent_stmt.setter
def parent_stmt(self, value):