diff options
author | Benjamin Peterson <benjamin@python.org> | 2011-07-03 18:48:36 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2011-07-03 18:48:36 (GMT) |
commit | 7b7099c36f30f1aca77f0ce285e3b68c4f23455e (patch) | |
tree | be4dfbb76d613124e8d0feaf92a433828b3811bc /Lib/test/test_exceptions.py | |
parent | 92843e3c144b3a7a78e1c6b11ec85f06227c42ab (diff) | |
parent | d2ed63024312630d11b0800d985f8b1fa96711a3 (diff) | |
download | cpython-7b7099c36f30f1aca77f0ce285e3b68c4f23455e.zip cpython-7b7099c36f30f1aca77f0ce285e3b68c4f23455e.tar.gz cpython-7b7099c36f30f1aca77f0ce285e3b68c4f23455e.tar.bz2 |
merge 3.2 (#12475)
Diffstat (limited to 'Lib/test/test_exceptions.py')
-rw-r--r-- | Lib/test/test_exceptions.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/Lib/test/test_exceptions.py b/Lib/test/test_exceptions.py index 592c765..03685b6 100644 --- a/Lib/test/test_exceptions.py +++ b/Lib/test/test_exceptions.py @@ -567,6 +567,21 @@ class ExceptionTests(unittest.TestCase): del g self.assertEqual(sys.exc_info()[0], TypeError) + def test_generator_leaking2(self): + # See issue 12475. + def g(): + yield + try: + raise RuntimeError + except RuntimeError: + it = g() + next(it) + try: + next(it) + except StopIteration: + pass + self.assertEqual(sys.exc_info(), (None, None, None)) + def test_generator_finalizing_and_exc_info(self): # See #7173 def simple_gen(): |