summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_coroutines.py
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2023-12-01 14:13:15 (GMT)
committerGitHub <noreply@github.com>2023-12-01 14:13:15 (GMT)
commit7eff607debb6e749a0066ec7fd20be2616c17da3 (patch)
treeca5dcf4bdf458e5fad47703d1d599f38c7d11baf /Lib/test/test_coroutines.py
parentedce0c4fb3e5f9fb26b2c214e3479ffa13dbaa43 (diff)
downloadcpython-7eff607debb6e749a0066ec7fd20be2616c17da3.zip
cpython-7eff607debb6e749a0066ec7fd20be2616c17da3.tar.gz
cpython-7eff607debb6e749a0066ec7fd20be2616c17da3.tar.bz2
[3.12] gh-111058: Change coro.cr_frame/gen.gi_frame to be None for a closed coroutine/generator. (GH-112428) (#112589)
Diffstat (limited to 'Lib/test/test_coroutines.py')
-rw-r--r--Lib/test/test_coroutines.py8
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():