Skip to content

Commit d99042d

Browse files
PEP 769: Fixed exception in a example code snippet. (#4273)
Fixed exception in a example code snippet.
1 parent 9a8c0f2 commit d99042d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

peps/pep-0769.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ The implementation of ``attrgetter`` is quite direct: it implies using
189189

190190
try:
191191
value = getattr(obj, "name")
192-
except (IndexError, KeyError):
192+
except AttributeError:
193193
value = XYZ
194194

195195
Note we cannot rely on using ``getattr`` with a default value, as it would

0 commit comments

Comments
 (0)