mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
merge 3.2 (#12475)
This commit is contained in:
commit
7b7099c36f
3 changed files with 23 additions and 4 deletions
|
@ -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():
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue