1.1 --- a/micropython/inspect.py Fri May 18 01:21:20 2012 +0200
1.2 +++ b/micropython/inspect.py Sat May 19 01:33:10 2012 +0200
1.3 @@ -75,6 +75,7 @@
1.4 from micropython.common import *
1.5 from micropython.data import *
1.6 import compiler.ast
1.7 +import sys
1.8
1.9 # Program visitors.
1.10
1.11 @@ -672,7 +673,7 @@
1.12
1.13 elif isinstance(value, Module):
1.14 self.store_module_attr(attrname, value)
1.15 - print "Warning: attribute %r of module %r set outside the module." % (node.attrname, expr.get_value().name)
1.16 + print >>sys.stderr, "Warning: attribute %r of module %r set outside the module." % (node.attrname, expr.get_value().name)
1.17
1.18 elif isinstance(value, Class):
1.19 self.store_class_attr(attrname, value)
1.20 @@ -699,7 +700,7 @@
1.21
1.22 def visitAssName(self, node):
1.23 if hasattr(node, "flags") and node.flags == "OP_DELETE":
1.24 - print "Warning: deletion of attribute %r in %r is not supported." % (node.name, self.full_name())
1.25 + print >>sys.stderr, "Warning: deletion of attribute %r in %r is not supported." % (node.name, self.full_name())
1.26 #raise InspectError("Deletion of attribute %r is not supported." % node.name)
1.27
1.28 self.store(node.name, self.expr)
1.29 @@ -765,11 +766,11 @@
1.30 """
1.31
1.32 if self.namespaces:
1.33 - print "Warning: class %r in %r is not global: ignored." % (node.name, self.namespaces[-1].full_name())
1.34 + print >>sys.stderr, "Warning: class %r in %r is not global: ignored." % (node.name, self.namespaces[-1].full_name())
1.35 return
1.36 else:
1.37 if self.in_loop:
1.38 - print "Warning: class %r in %r defined in a loop." % (node.name, self.full_name())
1.39 + print >>sys.stderr, "Warning: class %r in %r defined in a loop." % (node.name, self.full_name())
1.40
1.41 cls = get_class(node.name, self.get_namespace(), self, node)
1.42
1.43 @@ -933,7 +934,7 @@
1.44 module = self.importer.load(node.modname, 1)
1.45
1.46 #if module is None:
1.47 - # print "Warning:", node.modname, "not imported."
1.48 + # print >>sys.stderr, "Warning:", node.modname, "not imported."
1.49
1.50 for name, alias in node.names:
1.51 if name != "*":