summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_with.py
Commit message (Collapse)AuthorAgeFilesLines
* Better name for "Ctor".Georg Brandl2009-06-041-2/+2
|
* Allow multiple context managers in one with statement, as proposedGeorg Brandl2009-05-251-1/+77
| | | | | | | in http://codereview.appspot.com/53094 and accepted by Guido. The construct is transformed into multiple With AST nodes so that there should be no problems with the semantics.
* #4559: When a context manager's __exit__() method returns an object whoseAmaury Forgeot d'Arc2008-12-101-0/+30
| | | | | | | conversion to bool raises an exception, 'with' loses that exception. Reviewed by Jeffrey Yasskin. Already ported to 2.5, will port to 2.6 and 3.0
* Remove some from __future__ import with_statementsBenjamin Peterson2008-04-301-1/+0
|
* Fix for bug 1705170 - contextmanager swallowing StopIteration (2.5 backport ↵Nick Coghlan2007-11-021-0/+17
| | | | candidate)
* Finish bringing SVN into line with latest version of PEP 343 by getting rid ↵Nick Coghlan2006-05-031-7/+8
| | | | of all remaining references to context objects that I could find. Without a __context__() method context objects no longer exist. Also get test_with working again, and adopt a suggestion from Neal for decimal.Context.get_manager()
* Get rid of __context__, per the latest changes to PEP 343 and python-devGuido van Rossum2006-05-021-74/+7
| | | | | | | | discussion. There are two places of documentation that still mention __context__: Doc/lib/libstdtypes.tex -- I wasn't quite sure how to rewrite that without spending a whole lot of time thinking about it; and whatsnew, which Andrew usually likes to change himself.
* Rev 45706 renamed stuff in contextlib.py, but didn't renameTim Peters2006-04-261-8/+8
| | | | | | | | | | | | | | uses of it in test_with.py. As a result, test_with has been skipped (due to failing imports) on all buildbot boxes since. Alas, that's not a test failure -- you have to pay attention to the 1 skip unexpected on PLATFORM: test_with kinds of output at the ends of test runs to notice that this got broken. It's likely that more renaming in test_with.py would be desirable.
* Fix SF#1462485: StopIteration raised in body of 'with' statement suppressedPhillip J. Eby2006-04-031-0/+56
|
* Um, I thought I'd already checked this in.Guido van Rossum2006-03-101-10/+22
| | | | | | | Anyway, this is the changes to the with-statement so that __exit__ must return a true value in order for a pending exception to be ignored. The PEP (343) is already updated.
* Updates to the with-statement:Guido van Rossum2006-02-281-14/+70
| | | | | | | | | | | | | | | | - New semantics for __exit__() -- it must re-raise the exception if type is not None; the with-statement itself doesn't do this. (See the updated PEP for motivation.) - Added context managers to: - file - thread.LockType - threading.{Lock,RLock,Condition,Semaphore,BoundedSemaphore} - decimal.Context - Added contextlib.py, which defines @contextmanager, nested(), closing(). - Unit tests all around; bot no docs yet.
* from __future__ import with_statement addon for 'with', mostly written byThomas Wouters2006-02-281-0/+2
| | | | Neal.
* Set EOL style to native.Tim Peters2006-02-281-560/+560
|
* Whitespace normalization.Tim Peters2006-02-281-560/+560
|
* PEP 343 -- the with-statement.Guido van Rossum2006-02-271-0/+560
This was started by Mike Bland and completed by Guido (with help from Neal). This still needs a __future__ statement added; Thomas is working on Michael's patch for that aspect. There's a small amount of code cleanup and refactoring in ast.c, compile.c and ceval.c (I fixed the lltrace behavior when EXT_POP is used -- however I had to make lltrace a static global).