(self)
Display the exception that just occurred.

        We remove the first stack item because it is our own code.

        The output is written by self.write(), below.
Display the exception that just occurred.
Display the exception that just occurred .
def showtraceback(self):
        """Display the exception that just occurred.

        We remove the first stack item because it is our own code.

        The output is written by self.write(), below.

        """
        sys.last_type, sys.last_value, last_tb = ei = sys.exc_info()
        sys.last_traceback = last_tb
        try:
            lines = traceback.format_exception(ei[0], ei[1], last_tb.tb_next)
            if sys.excepthook is sys.__excepthook__:
                self.write(''.join(lines))
            else:
                # If someone has set sys.excepthook, we let that take precedence
                # over self.write
                sys.excepthook(ei[0], ei[1], last_tb)
        finally:
            last_tb = ei = None
def showtraceback ( self ) : sys . last_type , sys . last_value , last_tb = ei = sys . exc_info ( ) sys . last_traceback = last_tb try : lines = traceback . format_exception ( ei [ 0 ] , ei [ 1 ] , last_tb . tb_next ) if sys . excepthook is sys . __excepthook__ : self . write ( '' . join ( lines ) ) else : # If someone has set sys.excepthook, we let that take precedence # over self.write sys . excepthook ( ei [ 0 ] , ei [ 1 ] , last_tb ) finally : last_tb = ei = None