Skip to content

Commit

Permalink
PEP 769: Fixed exception in a example code snippet. (#4273)
Browse files Browse the repository at this point in the history
Fixed exception in a example code snippet.
  • Loading branch information
facundobatista authored Feb 16, 2025
1 parent 9a8c0f2 commit d99042d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion peps/pep-0769.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d99042d

Please sign in to comment.