def debugger(self,force=False):
if force or self.call_pdb:<EOL><INDENT>if self.pdb is None:<EOL><INDENT>self.pdb = debugger.Pdb(<EOL>self.color_scheme_table.active_scheme_name)<EOL><DEDENT>display_trap = DisplayTrap(hook=sys.__displayhook__)<EOL>with display_trap:<EOL><INDENT>self.pdb.reset()<EOL>if hasattr(self,'<STR_LIT>') and self.tb is not None:<EOL><INDENT>etb = self.tb<EOL><DEDENT>else:<EOL><INDENT>etb = self.tb = sys.last_traceback<EOL><DEDENT>while self.tb is not None and self.tb.tb_next is not None:<EOL><INDENT>self.tb = self.tb.tb_next<EOL><DEDENT>if etb and etb.tb_next:<EOL><INDENT>etb = etb.tb_next<EOL><DEDENT>self.pdb.botframe = etb.tb_frame<EOL>self.pdb.interaction(self.tb.tb_frame, self.tb)<EOL><DEDENT><DEDENT>if hasattr(self,'<STR_LIT>'):<EOL><INDENT>del self.tb<EOL><DEDENT>
Call up the pdb debugger if desired, always clean up the tb
        reference.

        Keywords:

          - force(False): by default, this routine checks the instance call_pdb
          flag and does not actually invoke the debugger if the flag is false.
          The 'force' option forces the debugger to activate even if the flag
          is false.

        If the call_pdb flag is set, the pdb interactive debugger is
        invoked. In all cases, the self.tb reference to the current traceback
        is deleted to prevent lingering references which hamper memory
        management.

        Note that each call to pdb() does an 'import readline', so if your app
        requires a special setup for the readline completers, you'll have to
        fix that by hand after invoking the exception handler.