def print_exc_plus():
sys.stderr.flush() <EOL>sys.stdout.flush() <EOL>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>click.secho(first_line, fg='<STR_LIT>')<EOL>for line in txt_lines:<EOL><INDENT>if line.strip().startswith("<STR_LIT>"):<EOL><INDENT>print(line)<EOL><DEDENT>else:<EOL><INDENT>click.secho(line, fg='<STR_LIT>', bold=True)<EOL>click.secho(line, fg="<STR_LIT>", bold=True)<EOL><DEDENT><DEDENT>click.secho(last_line, fg="<STR_LIT>")<EOL>print()<EOL>click.secho(<EOL>"<STR_LIT>",<EOL>fg="<STR_LIT>", bold=True<EOL>)<EOL>for frame in stack:<EOL><INDENT>click.secho('<STR_LIT>' % (<EOL>frame.f_code.co_filename,<EOL>frame.f_lineno,<EOL>frame.f_code.co_name,<EOL>),<EOL>fg="<STR_LIT>",<EOL>bold=True<EOL>)<EOL>for key, value in list(frame.f_locals.items()):<EOL><INDENT>print(click.style("<STR_LIT>" % key, bold=True), end='<STR_LIT:U+0020>')<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>print(value)<EOL><DEDENT>except:<EOL><INDENT>print("<STR_LIT>")<EOL><DEDENT><DEDENT><DEDENT>
Print the usual traceback information, followed by a listing of all the
local variables in each frame.