def exc_plus():
tb = sys.exc_info()[<NUM_LIT:2>]<EOL>while True:<EOL><INDENT>if not tb.tb_next:<EOL><INDENT>break<EOL><DEDENT>tb = tb.tb_next<EOL><DEDENT>stack = []<EOL>f = tb.tb_frame<EOL>while f:<EOL><INDENT>stack.append(f)<EOL>f = f.f_back<EOL><DEDENT>txt = traceback.format_exc()<EOL>txt_lines = txt.splitlines()<EOL>first_line = txt_lines.pop(<NUM_LIT:0>)<EOL>last_line = txt_lines.pop(-<NUM_LIT:1>)<EOL>yield click.style(first_line, fg="<STR_LIT>")<EOL>for line in txt_lines:<EOL><INDENT>if line.strip().startswith("<STR_LIT>"):<EOL><INDENT>yield line<EOL><DEDENT>else:<EOL><INDENT>yield click.style(line, fg="<STR_LIT>", bold=True)<EOL><DEDENT><DEDENT>yield click.style(last_line, fg="<STR_LIT>")<EOL>yield click.style("<STR_LIT>", fg="<STR_LIT>", bold=True)<EOL>for frame in stack:<EOL><INDENT>msg = '<STR_LIT>' % (frame.f_code.co_filename, frame.f_lineno, frame.f_code.co_name)<EOL>msg = click.style(msg, fg="<STR_LIT>", bold=True, underline=True)<EOL>yield "<STR_LIT>" % msg<EOL>for key, value in list(frame.f_locals.items()):<EOL><INDENT>key_info = "<STR_LIT>" % click.style(key, bold=True)<EOL>if isinstance(value, int):<EOL><INDENT>value = "<STR_LIT>" % (value, value)<EOL><DEDENT>else:<EOL><INDENT>value = repr(value)<EOL><DEDENT>if len(value) > MAX_CHARS:<EOL><INDENT>value = "<STR_LIT>" % value[:MAX_CHARS]<EOL><DEDENT>try:<EOL><INDENT>yield key_info + value<EOL><DEDENT>except:<EOL><INDENT>yield key_info + "<STR_LIT>"<EOL><DEDENT><DEDENT><DEDENT>
Print the usual traceback information, followed by a listing of all the
local variables in each frame.