]> granicus.if.org Git - python/commit
normalize exceptions passed to the __exit__ method #7853
authorBenjamin Peterson <benjamin@python.org>
Fri, 5 Feb 2010 02:12:14 +0000 (02:12 +0000)
committerBenjamin Peterson <benjamin@python.org>
Fri, 5 Feb 2010 02:12:14 +0000 (02:12 +0000)
commit565d78586babda2b62cbe4f89c2dd3cace79c0fa
treeaded6af69242e82a89f34df49512202d5c2ae08a
parent4a7ff1d80abf841287043c5965d1c1c74a1c694a
normalize exceptions passed to the __exit__ method #7853

In Python 2.x, exceptions in finally blocks are not normalized.  Since with
statements are implemented using finally blocks, ceval.c had to be tweaked to
distinguish between with finally blocks and normal ones.

A test for the finalization of generators containing with statements was also
added.
Lib/test/test_generators.py
Lib/test/test_with.py
Misc/NEWS
Python/ceval.c
Python/compile.c