diff --git a/Lib/test/test_descr.py b/Lib/test/test_descr.py index 3145dff81b4d89..f07d7d4596599c 100644 --- a/Lib/test/test_descr.py +++ b/Lib/test/test_descr.py @@ -4999,6 +4999,19 @@ class Child(Parent): gc.collect() self.assertEqual(Parent.__subclasses__(), []) + def test_attr_raise_through_property(self): + # add test case for gh-103272 + class A: + def __getattr__(self, name): + raise ValueError("FOO") + + @property + def foo(self): + return self.__getattr__("asdf") + + with self.assertRaisesRegex(ValueError, "FOO"): + A().foo + class DictProxyTests(unittest.TestCase): def setUp(self):