mirror of
https://github.com/python/cpython.git
synced 2025-12-15 21:44:50 +00:00
don't segfault on deleting __abstractmethods__ #10892
This commit is contained in:
parent
5e8dada491
commit
477ba919c1
3 changed files with 19 additions and 3 deletions
|
|
@ -4224,12 +4224,16 @@ order (MRO) for bases """
|
|||
|
||||
self.assertRaises(AttributeError, getattr, EvilGetattribute(), "attr")
|
||||
|
||||
def test_type_has_no_abstractmethods(self):
|
||||
def test_abstractmethods(self):
|
||||
# type pretends not to have __abstractmethods__.
|
||||
self.assertRaises(AttributeError, getattr, type, "__abstractmethods__")
|
||||
class meta(type):
|
||||
pass
|
||||
self.assertRaises(AttributeError, getattr, meta, "__abstractmethods__")
|
||||
class X(object):
|
||||
pass
|
||||
with self.assertRaises(AttributeError):
|
||||
del X.__abstractmethods__
|
||||
|
||||
|
||||
class DictProxyTests(unittest.TestCase):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue