mirror of
https://github.com/python/cpython.git
synced 2025-10-06 23:21:06 +00:00
merge 3.2
This commit is contained in:
commit
536feac7f8
3 changed files with 51 additions and 4 deletions
|
@ -582,6 +582,18 @@ class ExceptionTests(unittest.TestCase):
|
|||
pass
|
||||
self.assertEqual(sys.exc_info(), (None, None, None))
|
||||
|
||||
def test_generator_doesnt_retain_old_exc(self):
|
||||
def g():
|
||||
self.assertIsInstance(sys.exc_info()[1], RuntimeError)
|
||||
yield
|
||||
self.assertEqual(sys.exc_info(), (None, None, None))
|
||||
it = g()
|
||||
try:
|
||||
raise RuntimeError
|
||||
except RuntimeError:
|
||||
next(it)
|
||||
self.assertRaises(StopIteration, next, it)
|
||||
|
||||
def test_generator_finalizing_and_exc_info(self):
|
||||
# See #7173
|
||||
def simple_gen():
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue