Skip to content

Commit 6caca32

Browse files
committed
tests: Add test to print full KeyError exc from failed dict lookup.
1 parent 2750a7b commit 6caca32

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tests/basics/dict1.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@
2626
# value not found
2727
try:
2828
{}[0]
29-
except KeyError:
30-
print('KeyError')
29+
except KeyError as er:
30+
print('KeyError', er, repr(er), er.args)
3131

3232
# unsupported unary op
3333
try:

0 commit comments

Comments
 (0)