# HG changeset patch # User Paul Boddie # Date 1350689990 -7200 # Node ID 42ba81bc8e1f97ab28a63968db3f8d84a83909d4 # Parent 0bcb66c8b6e2069c13acf85ceda39895f82d8902 Removed hasattr tests for the unit attribute on various AST nodes since it should always be present on the nodes concerned. diff -r 0bcb66c8b6e2 -r 42ba81bc8e1f micropython/report.py --- a/micropython/report.py Sun Jul 15 00:14:45 2012 +0200 +++ b/micropython/report.py Sat Oct 20 01:39:50 2012 +0200 @@ -684,13 +684,9 @@ # Use inspected details where possible. - if hasattr(node, "unit"): - cls = node.unit - bases = cls.bases - self.stream.write("
\n" % cls.full_name()) - else: - print >>sys.stderr, "Warning: class %s not recognised!" % node.name - return + cls = node.unit + bases = cls.bases + self.stream.write("
\n" % cls.full_name()) # Write the declaration line. @@ -787,12 +783,8 @@ self._docstring('"Function %s not generated."' % node.name) return - if hasattr(node, "unit"): - fn = node.unit - self.stream.write("
\n" % fn.full_name()) - else: - print >>sys.stderr, "Warning: function %s not recognised!" % node.name - return + fn = node.unit + self.stream.write("
\n" % fn.full_name()) # Write the declaration line. @@ -1216,11 +1208,7 @@ self._span_end() def visitLambda(self, node): - if hasattr(node, "unit"): - fn = node.unit - else: - print >>sys.stderr, "Warning: function %s not recognised!" % node.name - return + fn = node.unit self._span_start("lambda") self._keyword("lambda")