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.

Author tcdelaney
Recipients
Date 2006-04-02.02:42:51
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
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.
History
Date User Action Args
2007-08-23 14:39:02adminlinkissue1462485 messages
2007-08-23 14:39:02admincreate