filename = tb.tb_frame.f_code.co_filename
name = tb.tb_frame.f_code.co_name
line_no = tb.tb_lineno
print(f' File "{filename}", line {line_no}, in {name}')
filename = tb.tb_frame.f_code.co_filename
name = tb.tb_frame.f_code.co_name
line_no = tb.tb_lineno
print(f' File "{filename}", line {line_no}, in {name}')
if exc_type is RuntimeError:
for n,v in tb.tb_frame.f_locals.items():
print(f' {n} -> {v}')
if exc_type is RuntimeError:
for n,v in tb.tb_frame.f_locals.items():
print(f' {n} -> {v}')