mirror of
https://github.com/pocketpy/pocketpy
synced 2025-10-20 03:20:18 +00:00
commit b584de5c3d4603a476cdd60830289104784a4942 Author: blueloveTH <blueloveth@foxmail.com> Date: Thu Jun 13 10:46:07 2024 +0800 some fix commit 1fe8a3280949d724ddab9c6b1476e1b55c5beb9d Author: blueloveTH <blueloveth@foxmail.com> Date: Wed Jun 12 22:08:09 2024 +0800 backup
19 lines
366 B
Python
19 lines
366 B
Python
import traceback
|
|
|
|
try:
|
|
a = {'123': 4}
|
|
b = a[6]
|
|
except KeyError:
|
|
actual = traceback.format_exc()
|
|
|
|
expected = '''Traceback (most recent call last):
|
|
File "80_traceback.py", line 5
|
|
b = a[6]
|
|
KeyError: 6'''
|
|
|
|
if actual != expected:
|
|
print('--- ACTUAL RESULT -----')
|
|
print(actual)
|
|
print('--- EXPECTED RESULT ---')
|
|
print(expected)
|
|
exit(1) |