don't segfault on deleting __abstractmethods__ #10892
diff --git a/Lib/test/test_descr.py b/Lib/test/test_descr.py
index a81c218..914b249 100644
--- a/Lib/test/test_descr.py
+++ b/Lib/test/test_descr.py
@@ -4224,12 +4224,16 @@
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):