From d99042d084c53033ad70eb03b79f375ce95a3c5b Mon Sep 17 00:00:00 2001 From: Facundo Batista Date: Sun, 16 Feb 2025 10:25:49 -0300 Subject: [PATCH] PEP 769: Fixed exception in a example code snippet. (#4273) Fixed exception in a example code snippet. --- peps/pep-0769.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/peps/pep-0769.rst b/peps/pep-0769.rst index d51bf6e2009..cb3df6d50a5 100644 --- a/peps/pep-0769.rst +++ b/peps/pep-0769.rst @@ -189,7 +189,7 @@ The implementation of ``attrgetter`` is quite direct: it implies using try: value = getattr(obj, "name") - except (IndexError, KeyError): + except AttributeError: value = XYZ Note we cannot rely on using ``getattr`` with a default value, as it would