summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_exceptions.py
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2022-09-08 11:46:53 (GMT)
committerGitHub <noreply@github.com>2022-09-08 11:46:53 (GMT)
commit19b94bc136b188d3da5ab8d02b93eb55a48bc641 (patch)
tree405329a8fe5e10102ffb69f481c2e0e98a4c0f14 /Lib/test/test_exceptions.py
parent3ae2be69cc7d99979e00d2ea9217496b8529bdd6 (diff)
downloadcpython-19b94bc136b188d3da5ab8d02b93eb55a48bc641.zip
cpython-19b94bc136b188d3da5ab8d02b93eb55a48bc641.tar.gz
cpython-19b94bc136b188d3da5ab8d02b93eb55a48bc641.tar.bz2
gh-96352: Set AttributeError context in _PyObject_GenericGetAttrWithDict (GH-96353)
(cherry picked from commit b9634ac776c24bc4d4a57859d884a94cdfe16043) Co-authored-by: philg314 <110174000+philg314@users.noreply.github.com>
Diffstat (limited to 'Lib/test/test_exceptions.py')
-rw-r--r--Lib/test/test_exceptions.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/Lib/test/test_exceptions.py b/Lib/test/test_exceptions.py
index d9ea8a4..5cdbfcd 100644
--- a/Lib/test/test_exceptions.py
+++ b/Lib/test/test_exceptions.py
@@ -1981,6 +1981,11 @@ class AttributeErrorTests(unittest.TestCase):
except AttributeError as exc:
self.assertEqual("bluch", exc.name)
self.assertEqual(obj, exc.obj)
+ try:
+ object.__getattribute__(obj, "bluch")
+ except AttributeError as exc:
+ self.assertEqual("bluch", exc.name)
+ self.assertEqual(obj, exc.obj)
def test_getattr_has_name_and_obj_for_method(self):
class A: