Skip to content

Commit

Permalink
Fixed exception in a example code snippet.
Browse files Browse the repository at this point in the history
  • Loading branch information
facundobatista committed Feb 16, 2025
1 parent 9a8c0f2 commit f5e9f95
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 f5e9f95

Please sign in to comment.