def post_mortem(exc=None, frameno=<NUM_LIT:1>, dbg=None):
if dbg is None:<EOL><INDENT>if Mdebugger.debugger_obj is None:<EOL><INDENT>Mdebugger.debugger_obj = Mdebugger.Trepan()<EOL>pass<EOL><DEDENT>dbg = Mdebugger.debugger_obj<EOL>pass<EOL><DEDENT>re_bogus_file = re.compile("<STR_LIT>")<EOL>if exc[<NUM_LIT:0>] is None:<EOL><INDENT>exc = get_last_or_frame_exception()<EOL>if exc[<NUM_LIT:0>] is None:<EOL><INDENT>print("<STR_LIT>"<EOL>"<STR_LIT>")<EOL>return<EOL><DEDENT>pass<EOL><DEDENT>exc_type, exc_value, exc_tb = exc<EOL>dbg.core.execution_status = ('<STR_LIT>'<EOL>% exc_type)<EOL>if exc_tb is not None:<EOL><INDENT>while exc_tb.tb_next is not None:<EOL><INDENT>filename = exc_tb.tb_frame.f_code.co_filename<EOL>if (dbg.mainpyfile and <NUM_LIT:0> == len(dbg.mainpyfile)<EOL>and not re_bogus_file.match(filename)):<EOL><INDENT>dbg.mainpyfile = filename<EOL>pass<EOL><DEDENT>exc_tb = exc_tb.tb_next<EOL>pass<EOL><DEDENT>dbg.core.processor.curframe = exc_tb.tb_frame<EOL>pass<EOL><DEDENT>if <NUM_LIT:0> == len(dbg.program_sys_argv):<EOL><INDENT>dbg.program_sys_argv = list(sys.argv[<NUM_LIT:1>:])<EOL>dbg.program_sys_argv[:<NUM_LIT:0>] = [dbg.mainpyfile]<EOL><DEDENT>try:<EOL><INDENT>f = exc_tb.tb_frame<EOL>if f and f.f_lineno != exc_tb.tb_lineno : f = f.f_back<EOL>dbg.core.processor.event_processor(f, '<STR_LIT>', exc, '<STR_LIT>')<EOL><DEDENT>except DebuggerRestart:<EOL><INDENT>while True:<EOL><INDENT>sys.argv = list(dbg._program_sys_argv)<EOL>dbg.msg("<STR_LIT>"<EOL>% (dbg.filename(dbg.mainpyfile),<EOL>"<STR_LIT:U+0020>".join(dbg._program_sys_argv[<NUM_LIT:1>:])))<EOL>try:<EOL><INDENT>dbg.run_script(dbg.mainpyfile)<EOL><DEDENT>except DebuggerRestart:<EOL><INDENT>pass<EOL><DEDENT>pass<EOL><DEDENT><DEDENT>except DebuggerQuit:<EOL><INDENT>pass<EOL><DEDENT>return<EOL>
Enter debugger read loop after your program has crashed.

    exc is a triple like you get back from sys.exc_info.  If no exc
    parameter, is supplied, the values from sys.last_type,
    sys.last_value, sys.last_traceback are used. And if these don't
    exist either we'll assume that sys.exc_info() contains what we
    want and frameno is the index location of where we want to start.

    'frameno' specifies how many frames to ignore in the traceback.
    The default is 1, that is, we don't need to show the immediate
    call into post_mortem. If you have wrapper functions that call
    this one, you may want to increase frameno.