check for string attribute names in old-style classes (closes #14334)
diff --git a/Lib/test/test_class.py b/Lib/test/test_class.py
index db75b93..e5cdf08 100644
--- a/Lib/test/test_class.py
+++ b/Lib/test/test_class.py
@@ -628,6 +628,13 @@
a = A(hash(A.f.im_func)^(-1))
hash(a.f)
+ def testAttrSlots(self):
+ class C:
+ pass
+ for c in C, C():
+ self.assertRaises(TypeError, type(c).__getattribute__, c, [])
+ self.assertRaises(TypeError, type(c).__setattr__, c, [], [])
+
def test_main():
with test_support.check_py3k_warnings(
(".+__(get|set|del)slice__ has been removed", DeprecationWarning),