1.1 --- a/annotate.py Tue Feb 06 00:57:50 2007 +0100
1.2 +++ b/annotate.py Wed Feb 14 01:34:35 2007 +0100
1.3 @@ -344,6 +344,12 @@
1.4 self.module.namespace = self.namespace
1.5 self.namespace.merge_namespace(saved_namespace)
1.6
1.7 + # NOTE: Exception recording.
1.8 +
1.9 + else:
1.10 + test_raises = []
1.11 + combine(test_raises, self.namespace.raises)
1.12 +
1.13 # Process the body clause.
1.14
1.15 conditional.body = self.dispatches(conditional.body)
1.16 @@ -370,10 +376,12 @@
1.17 self.namespace.merge_namespace(else_namespace)
1.18
1.19 # NOTE: Test of exception type pruning based on the test/body.
1.20 + # Note that the checked exceptions are tested for re-raising.
1.21
1.22 if conditional.isolate_test:
1.23 - for exc_type in body_namespace.raises:
1.24 - self.namespace.revoke_exception_type(exc_type)
1.25 + for exc_type in test_raises:
1.26 + if exc_type not in body_namespace.raises:
1.27 + self.namespace.revoke_exception_type(exc_type)
1.28
1.29 return conditional
1.30
1.31 @@ -719,6 +727,10 @@
1.32 pass #raise AnnotationMessage, "Temporary store index '%s' is empty." % index
1.33 return releasetemp
1.34
1.35 + def visitResetExc(self, resetexc):
1.36 + self.namespace.raises = []
1.37 + return resetexc
1.38 +
1.39 def visitReturn(self, return_):
1.40
1.41 """
1.42 @@ -777,6 +789,7 @@
1.43
1.44 storename.expr = self.dispatch(storename.expr)
1.45 self.namespace.store(storename.name, self.namespace.types)
1.46 + self.annotate(storename)
1.47 return storename
1.48
1.49 def visitStoreTemp(self, storetemp):