mirror of
https://github.com/python/cpython.git
synced 2025-10-09 16:34:44 +00:00
bpo-45813: Drop redundant assertion from frame.clear() (GH-29990)
* bpo-45813: Drop redundant assertion from frame.clear() * Move assertion to frame_dealloc()
This commit is contained in:
parent
69806b9516
commit
d4363d2140
2 changed files with 15 additions and 3 deletions
|
@ -2191,13 +2191,22 @@ class CoroutineTest(unittest.TestCase):
|
|||
return 'end'
|
||||
self.assertEqual(run_async(run_gen()), ([], 'end'))
|
||||
|
||||
def test_bpo_45813(self):
|
||||
def test_bpo_45813_1(self):
|
||||
'This would crash the interpreter in 3.11a2'
|
||||
async def f():
|
||||
pass
|
||||
frame = f().cr_frame
|
||||
with self.assertWarns(RuntimeWarning):
|
||||
frame = f().cr_frame
|
||||
frame.clear()
|
||||
|
||||
def test_bpo_45813_2(self):
|
||||
'This would crash the interpreter in 3.11a2'
|
||||
async def f():
|
||||
pass
|
||||
gen = f()
|
||||
with self.assertWarns(RuntimeWarning):
|
||||
gen.cr_frame.clear()
|
||||
|
||||
|
||||
class CoroAsyncIOCompatTest(unittest.TestCase):
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue