# HG changeset patch # User paulb@localhost.localdomain # Date 1171474388 -3600 # Node ID 98912a726919fc774e511f64c6e75a8679c86063 # Parent 54a71eb2fd00d34e29e186454a9b4bad07b5b678 Fixed disappearing exceptions where unprocessed invocations (due to type information completeness) failed to provide raised exception information (unlike when processed normally), thus "erasing" such information from the caller's namespace. Introduced a copy_of annotation used to generate appropriate invocation hyperlinks for "original functions" in the viewer. diff -r 54a71eb2fd00 -r 98912a726919 annotate.py --- a/annotate.py Wed Feb 14 01:34:35 2007 +0100 +++ b/annotate.py Wed Feb 14 18:33:08 2007 +0100 @@ -501,6 +501,7 @@ invoke.invocations = invocations self.namespace.set_types(getattr(invoke, "types", [])) + combine(self.namespace.raises, getattr(invoke, "raises", [])) return invoke def visitInvokeBlock(self, invoke): @@ -998,7 +999,9 @@ # Incorporate any raised exceptions. - combine(self.namespace.raises, self.last_raises) + if not hasattr(invoke, "raises"): + invoke.raises = [] + combine(invoke.raises, self.last_raises) # In order to keep global accesses working, the module namespace must be # adjusted. diff -r 54a71eb2fd00 -r 98912a726919 simplified.py --- a/simplified.py Wed Feb 14 01:34:35 2007 +0100 +++ b/simplified.py Wed Feb 14 18:33:08 2007 +0100 @@ -300,6 +300,7 @@ common[attr] = getattr(self, attr) if new_name is not None: + common["copy_of"] = self common["name"] = new_name # Instantiate the copy, avoiding side-effects with original and defining. diff -r 54a71eb2fd00 -r 98912a726919 viewer.py --- a/viewer.py Wed Feb 14 01:34:35 2007 +0100 +++ b/viewer.py Wed Feb 14 18:33:08 2007 +0100 @@ -920,13 +920,14 @@ def _invocations_list(self, node): if hasattr(node, "invocations"): for invocation in node.invocations: - fn = invocation.full_name() + fn = getattr(invocation, "copy_of", invocation).full_name() module = invocation.module.name name = invocation.name structures = [x.name for x in invocation.structures] + qualified_name = ".".join([module] + structures + [name]) self.stream.write("
") self.stream.write("" % (self._url(module), self._url(fn))) - self.stream.write(self._text(".".join([module] + structures + [name]))) + self.stream.write(self._text(qualified_name)) self.stream.write("") self.stream.write("
\n")