1.1 --- a/micropython/ast.py Sun Jul 11 02:05:41 2010 +0200
1.2 +++ b/micropython/ast.py Sat Aug 07 02:06:15 2010 +0200
1.3 @@ -564,7 +564,7 @@
1.4 self.discard_temp(temp2)
1.5
1.6 def visitClass(self, node):
1.7 - if not node.unit.parent.has_key(node.unit.name):
1.8 + if not used_by_unit(node):
1.9 return
1.10
1.11 # Store the name.
1.12 @@ -587,7 +587,7 @@
1.13 def visitFrom(self, node): pass
1.14
1.15 def visitFunction(self, node):
1.16 - if not node.unit.parent.has_key(node.unit.name):
1.17 + if not used_by_unit(node):
1.18 return
1.19
1.20 # Only store the name when visiting this node from outside.