check type_getattro for correctness in a descriptor corner case

This commit is contained in:
Benjamin Peterson 2010-02-06 20:14:10 +00:00
parent 5749d88243
commit 42d5947ef5
1 changed files with 9 additions and 0 deletions

View File

@ -4516,6 +4516,15 @@ order (MRO) for bases """
x.a = 42 x.a = 42
self.assertEqual(x.a, 42) self.assertEqual(x.a, 42)
# Also check type_getattro for correctness.
class Meta(type):
pass
class X(object):
__metaclass__ = Meta
X.a = 42
Meta.a = Descr("a")
self.assertEqual(X.a, 42)
def test_getattr_hooks(self): def test_getattr_hooks(self):
# issue 4230 # issue 4230