1.1 --- a/micropython/inspect.py Sat Nov 06 00:57:43 2010 +0100
1.2 +++ b/micropython/inspect.py Thu Jan 13 23:58:12 2011 +0100
1.3 @@ -210,7 +210,7 @@
1.4 # have been defined within the object and therefore are not
1.5 # redefined by other code regions.
1.6
1.7 - if attr.assignments == 1:
1.8 + if attr is not None and attr.assignments == 1:
1.9 value = attr.get_value()
1.10
1.11 if value is not obj and value in self.all_objects:
1.12 @@ -1006,9 +1006,15 @@
1.13
1.14 visitPower = _visitBinary
1.15
1.16 - visitPrint = NOP
1.17 + def _visitPrint(self, node, function_name):
1.18 + self.NOP(node)
1.19 + self.use_specific_attribute("__builtins__", function_name)
1.20
1.21 - visitPrintnl = NOP
1.22 + def visitPrint(self, node):
1.23 + self._visitPrint(node, "_print")
1.24 +
1.25 + def visitPrintnl(self, node):
1.26 + self._visitPrint(node, "_printnl")
1.27
1.28 visitRaise = NOP_ABANDON
1.29