1.1 --- a/micropython/inspect.py Sun Jun 06 15:27:50 2010 +0200
1.2 +++ b/micropython/inspect.py Sat Jun 12 01:04:32 2010 +0200
1.3 @@ -899,6 +899,7 @@
1.4
1.5 if self.importer.predefined_constants.has_key(name):
1.6 attr = self.importer.get_predefined_constant(name)
1.7 + node._scope = "constant"
1.8
1.9 # Locals.
1.10
1.11 @@ -908,6 +909,7 @@
1.12 # Note usage of the local (potentially a class attribute).
1.13
1.14 self.use_specific_attribute(None, name)
1.15 + node._scope = "local"
1.16
1.17 # Globals.
1.18
1.19 @@ -917,18 +919,21 @@
1.20 # Note usage of the module attribute.
1.21
1.22 self.use_specific_attribute(self.full_name(), name)
1.23 + node._scope = "global"
1.24
1.25 # Builtins.
1.26
1.27 elif self.builtins is not None and self.builtins.has_key(name):
1.28 attr = self.builtins[name]
1.29 self.use_specific_attribute(self.builtins.full_name(), name)
1.30 + node._scope = "builtins"
1.31
1.32 # Unknown.
1.33
1.34 else:
1.35 attr = None
1.36 self.use_name(name)
1.37 + node._scope = "unknown"
1.38
1.39 return attr
1.40