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