From f5e9f951ee1cf9dcb4d9cdf0412348c4d27aff71 Mon Sep 17 00:00:00 2001 From: Facundo Batista Date: Sun, 16 Feb 2025 10:21:33 -0300 Subject: [PATCH] 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