1.1 --- a/micropython/inspect.py Mon Jun 14 01:46:42 2010 +0200
1.2 +++ b/micropython/inspect.py Tue Jun 15 00:50:51 2010 +0200
1.3 @@ -146,13 +146,13 @@
1.4 for node, namespaces in self.functions:
1.5 self.process_globals(node)
1.6
1.7 - self.finalise_namespace(self)
1.8 + self.finalise_attribute_usage()
1.9
1.10 # Then, visit each function, recording other names.
1.11
1.12 for node, namespaces in self.functions:
1.13 self._visitFunctionBody(node, namespaces)
1.14 - self.finalise_namespace(namespaces[-1])
1.15 + namespaces[-1].finalise_attribute_usage()
1.16
1.17 # Add references to other modules declared using the __all__ global.
1.18
1.19 @@ -179,13 +179,6 @@
1.20 else:
1.21 self.process_globals(n)
1.22
1.23 - def finalise_namespace(self, namespace):
1.24 -
1.25 - "Finalise the given 'namespace'."
1.26 -
1.27 - for names in namespace.get_all_attribute_usage():
1.28 - self.importer.use_names(names, namespace.full_name())
1.29 -
1.30 def vacuum(self):
1.31
1.32 """
1.33 @@ -211,7 +204,7 @@
1.34 # Only consider deleting entire unused objects or things accessible
1.35 # via names which are never used.
1.36
1.37 - if delete_all or not self.importer.uses_attribute(obj, name):
1.38 + if delete_all or not self.importer.uses_attribute(obj.full_name(), name):
1.39 del obj[name]
1.40
1.41 # Delete any unambiguous attribute value. Such values can only
1.42 @@ -645,7 +638,7 @@
1.43
1.44 self.namespaces.append(cls)
1.45 self.dispatch(node.code)
1.46 - self.finalise_namespace(cls)
1.47 + cls.finalise_attribute_usage()
1.48 self.namespaces.pop()
1.49
1.50 return cls