There's an obscure bug in sys.exc_info after a yield statement. def test(): def raising_generator(): try: raise IndexError("inner exception") except IndexError: yield 3 # Here, sys.exc_info() ought to refer to the inner # exception, but instead it refers to the outer one. try: raise ValueError("outer exception") except ValueError: for i in raising_generator(): pass sys.exc_info gets reset even if there's no outer exception. The attached (failing) patch highlights this problem, and tests other sys.exc_info behavior around function calls.
I think we should _not_ backport any fix for this bug to the 2.6 series, since any changes to user behavior would be pretty subtle. To prevent that backport, I'd like to apply exc_info_26.patch to the 2.6 branch, with Barry's approval.
Adding some tests to check that a bug is /not/ fixed looks weird to me. If we did that for every trunk change that we don't want to end up in the stable branch, there'd be lots of new tests of dubious utility. Besides, py3k isn't affected ;)