mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
gh-111058: Change coro.cr_frame/gen.gi_frame to be None for a closed coroutine/generator. (#112428)
This commit is contained in:
parent
a65a3d4806
commit
bfb576ee23
4 changed files with 20 additions and 1 deletions
|
@ -2216,6 +2216,14 @@ class CoroutineTest(unittest.TestCase):
|
|||
gen.cr_frame.clear()
|
||||
gen.close()
|
||||
|
||||
def test_cr_frame_after_close(self):
|
||||
async def f():
|
||||
pass
|
||||
gen = f()
|
||||
self.assertIsNotNone(gen.cr_frame)
|
||||
gen.close()
|
||||
self.assertIsNone(gen.cr_frame)
|
||||
|
||||
def test_stack_in_coroutine_throw(self):
|
||||
# Regression test for https://github.com/python/cpython/issues/93592
|
||||
async def a():
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue