mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
bpo-35504: Fix segfaults and SystemErrors when deleting certain attrs. (GH-11175)
This commit is contained in:
parent
4db62e1158
commit
842acaab13
15 changed files with 81 additions and 4 deletions
|
@ -109,10 +109,7 @@ class ClearTest(unittest.TestCase):
|
|||
self.assertIs(None, wr())
|
||||
|
||||
|
||||
class FrameLocalsTest(unittest.TestCase):
|
||||
"""
|
||||
Tests for the .f_locals attribute.
|
||||
"""
|
||||
class FrameAttrsTest(unittest.TestCase):
|
||||
|
||||
def make_frames(self):
|
||||
def outer():
|
||||
|
@ -159,6 +156,11 @@ class FrameLocalsTest(unittest.TestCase):
|
|||
self.assertEqual(outer.f_locals, {})
|
||||
self.assertEqual(inner.f_locals, {})
|
||||
|
||||
def test_f_lineno_del_segfault(self):
|
||||
f, _, _ = self.make_frames()
|
||||
with self.assertRaises(AttributeError):
|
||||
del f.f_lineno
|
||||
|
||||
|
||||
class ReprTest(unittest.TestCase):
|
||||
"""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue