This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: New with semantics
Type: Stage:
Components: Interpreter Core Versions: Python 2.5
process
Status: closed Resolution: accepted
Dependencies: Superseder:
Assigned To: gvanrossum Nosy List: gvanrossum, nnorwitz
Priority: normal Keywords: patch

Created on 2006-03-08 15:50 by gvanrossum, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
new_with.patch gvanrossum, 2006-03-08 15:50 first rough patch
Messages (2)
msg49689 - (view) Author: Guido van Rossum (gvanrossum) * (Python committer) Date: 2006-03-08 15:50
Here's a patch that implements the new with statement
semantics: if __exit__ got passed an exception, it is
only swallowed when __exit__ returns *true*.  So it is
no longer necessary for __exit__ handlers to re-raise
the exception.

This is a bit rough still -- existing unit tests have
been adjusted, but there should be additional unit
tests for the new functionality.  Also the re-raise
code in various __exit__ handlers coded in the previous
patch could be removed (note that re-raising doesn't do
any harm -- it's just not necessary).
msg49690 - (view) Author: Neal Norwitz (nnorwitz) * (Python committer) Date: 2006-03-15 07:59
Logged In: YES 
user_id=33168

Guido checked this in a few days ago AFAIK, so closing.
History
Date User Action Args
2022-04-11 14:56:15adminsetgithub: 42996
2006-03-08 15:50:55gvanrossumcreate