diff options
author | Irit Katriel <1055913+iritkatriel@users.noreply.github.com> | 2023-12-01 12:57:31 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-01 12:57:31 (GMT) |
commit | bfb576ee23c133bec0ce7c26a8ecea76926b9d8e (patch) | |
tree | c13aa718ec68f94116a97a64c161545112f41851 /Lib/test/test_coroutines.py | |
parent | a65a3d4806a4087f229b5ab6ab28d3e0b0a2d840 (diff) | |
download | cpython-bfb576ee23c133bec0ce7c26a8ecea76926b9d8e.zip cpython-bfb576ee23c133bec0ce7c26a8ecea76926b9d8e.tar.gz cpython-bfb576ee23c133bec0ce7c26a8ecea76926b9d8e.tar.bz2 |
gh-111058: Change coro.cr_frame/gen.gi_frame to be None for a closed coroutine/generator. (#112428)
Diffstat (limited to 'Lib/test/test_coroutines.py')
-rw-r--r-- | Lib/test/test_coroutines.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/test/test_coroutines.py b/Lib/test/test_coroutines.py index 4714578..25c981d 100644 --- a/Lib/test/test_coroutines.py +++ b/Lib/test/test_coroutines.py @@ -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(): |