# HG changeset patch # User paulb@localhost.localdomain # Date 1171567957 -3600 # Node ID 0e071a78202267129a08550fc33154125515eb4c # Parent 7c3865d806321a5bb0e5033cd15403808ae73c83 Made a distinct raises annotation on subprograms. diff -r 7c3865d80632 -r 0e071a782022 annotate.py --- a/annotate.py Thu Feb 15 20:16:42 2007 +0100 +++ b/annotate.py Thu Feb 15 20:32:37 2007 +0100 @@ -216,6 +216,9 @@ node.namespace = self.namespace result = self.dispatch(node) result.namespace = self.namespace + if not hasattr(result, "raises"): + result.raises = [] + combine(result.raises, self.namespace.raises) # Obtain the return values. @@ -511,7 +514,6 @@ invoke.invocations = invocations self.namespace.set_types(getattr(invoke, "types", [])) - combine(self.namespace.raises, getattr(invoke, "raises", [])) return invoke def visitInvokeBlock(self, invoke): @@ -1012,6 +1014,7 @@ if not hasattr(invoke, "raises"): invoke.raises = [] combine(invoke.raises, self.last_raises) + combine(self.namespace.raises, self.last_raises) # In order to keep global accesses working, the module namespace must be # adjusted. diff -r 7c3865d80632 -r 0e071a782022 viewer.py --- a/viewer.py Thu Feb 15 20:16:42 2007 +0100 +++ b/viewer.py Thu Feb 15 20:32:37 2007 +0100 @@ -984,8 +984,8 @@ self.stream.write("
\n") for node in nodes: - if hasattr(node, "namespace") and hasattr(node.namespace, "raises") and node.namespace.raises: - self._types_list(node.namespace.raises) + if hasattr(node, "raises") and node.raises: + self._types_list(node.raises) self.stream.write("
\n") def _scopes(self, nodes):