1.1 --- a/micropython/inspect.py Thu Jan 13 23:58:12 2011 +0100
1.2 +++ b/micropython/inspect.py Sat Jan 29 21:07:27 2011 +0100
1.3 @@ -3,7 +3,7 @@
1.4 """
1.5 Inspect source files, obtaining details of classes and attributes.
1.6
1.7 -Copyright (C) 2007, 2008, 2009, 2010 Paul Boddie <paul@boddie.org.uk>
1.8 +Copyright (C) 2007, 2008, 2009, 2010, 2011 Paul Boddie <paul@boddie.org.uk>
1.9
1.10 This program is free software; you can redistribute it and/or modify it under
1.11 the terms of the GNU General Public License as published by the Free Software
1.12 @@ -213,7 +213,9 @@
1.13 if attr is not None and attr.assignments == 1:
1.14 value = attr.get_value()
1.15
1.16 - if value is not obj and value in self.all_objects:
1.17 + # The value must have this object as a parent.
1.18 +
1.19 + if value is not obj and value.parent is obj and value in self.all_objects:
1.20 self.all_objects.remove(value)
1.21
1.22 # Delete class contents and lambdas from functions.
1.23 @@ -686,7 +688,7 @@
1.24 if self.in_loop:
1.25 print "Warning: class %r in %r defined in a loop." % (node.name, self.full_name())
1.26
1.27 - cls = Class(node.name, self.get_namespace(), self, node)
1.28 + cls = get_class(node.name, self.get_namespace(), self, node)
1.29
1.30 # Make a back reference from the node for code generation.
1.31