Message28011
Logged In: YES
user_id=603121
Attached diffs to test_with.py which adds tests for raising StopIteration (and GeneratorExit) from the body of a with-statement where the context manager is either a generator, or a class instance.
I think the correct behaviour is to return False from GeneratorContextManager.__exit__ if the thrown exception is a StopIteration, and the exact same instance is raised from self.gen.throw(). Diffs for this also attached. |
|
Date |
User |
Action |
Args |
2007-08-23 14:39:02 | admin | link | issue1462485 messages |
2007-08-23 14:39:02 | admin | create | |
|