pocketpy/tests/80_traceback.py
2023-10-08 01:36:11 +08:00

14 lines
226 B
Python

import traceback
try:
a = {'123': 4}
b = a[6]
except KeyError:
s = traceback.format_exc()
ok = s == '''Traceback (most recent call last):
File "80_traceback.py", line 5
b = a[6]
KeyError: 6'''
assert ok, s