summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorMark Shannon <mark@hotpy.org>2021-11-22 14:01:23 (GMT)
committerGitHub <noreply@github.com>2021-11-22 14:01:23 (GMT)
commit7fd92a8b7ee5bed28c2681fa38e0a1e76200dd8e (patch)
tree46c7f7aed9809c9a7d5f6b6a50eb151b1e2e8a38 /Lib
parentd9cedabeba0d87799f99c0717e81743a1c2d34ce (diff)
downloadcpython-7fd92a8b7ee5bed28c2681fa38e0a1e76200dd8e.zip
cpython-7fd92a8b7ee5bed28c2681fa38e0a1e76200dd8e.tar.gz
cpython-7fd92a8b7ee5bed28c2681fa38e0a1e76200dd8e.tar.bz2
bpo-45813: Make sure that frame->generator is NULLed when generator is deallocated. (GH-29700)
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_coroutines.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/Lib/test/test_coroutines.py b/Lib/test/test_coroutines.py
index 4350e18..fc8b8bc 100644
--- a/Lib/test/test_coroutines.py
+++ b/Lib/test/test_coroutines.py
@@ -2191,6 +2191,13 @@ class CoroutineTest(unittest.TestCase):
return 'end'
self.assertEqual(run_async(run_gen()), ([], 'end'))
+ def test_bpo_45813(self):
+ 'This would crash the interpreter in 3.11a2'
+ async def f():
+ pass
+ frame = f().cr_frame
+ frame.clear()
+
class CoroAsyncIOCompatTest(unittest.TestCase):