parameters: (self, etype, evalue, etb)
docstring: Handle an exception, call for compatible with sys.excepthook
docstring_summary: Handle an exception, call for compatible with sys.excepthook
docstring_tokens: Handle an exception call for compatible with sys . excepthook
function: def __call__(self, etype, evalue, etb):
          """Handle an exception, call for compatible with sys.excepthook"""
          
          # do not allow the crash handler to be called twice without reinstalling it
          # this prevents unlikely errors in the crash handling from entering an
          # infinite loop.
          sys.excepthook = sys.__excepthook__
          
          # Report tracebacks shouldn't use color in general (safer for users)
          color_scheme = 'NoColor'
  
          # Use this ONLY for developer debugging (keep commented out for release)
          #color_scheme = 'Linux'   # dbg
          try:
              rptdir = self.app.ipython_dir
          except:
              rptdir = os.getcwd()
          if rptdir is None or not os.path.isdir(rptdir):
              rptdir = os.getcwd()
          report_name = os.path.join(rptdir,self.crash_report_fname)
          # write the report filename into the instance dict so it can get
          # properly expanded out in the user message template
          self.crash_report_fname = report_name
          self.info['crash_report_fname'] = report_name
          TBhandler = ultratb.VerboseTB(
              color_scheme=color_scheme,
              long_header=1,
              call_pdb=self.call_pdb,
          )
          if self.call_pdb:
              TBhandler(etype,evalue,etb)
              return
          else:
              traceback = TBhandler.text(etype,evalue,etb,context=31)
  
          # print traceback to screen
          if self.show_crash_traceback:
              print(traceback, file=sys.stderr)
  
          # and generate a complete report on disk
          try:
              report = open(report_name,'w')
          except:
              print('Could not create crash report on disk.', file=sys.stderr)
              return
  
          with report:
              # Inform user on stderr of what happened
              print('\n'+'*'*70+'\n', file=sys.stderr)
              print(self.message_template.format(**self.info), file=sys.stderr)
  
              # Construct report on disk
              report.write(self.make_report(traceback))
  
          input("Hit <Enter> to quit (your terminal may close):")
function_tokens: def __call__ ( self , etype , evalue , etb ) : # do not allow the crash handler to be called twice without reinstalling it # this prevents unlikely errors in the crash handling from entering an # infinite loop. sys . excepthook = sys . __excepthook__ # Report tracebacks shouldn't use color in general (safer for users) color_scheme = 'NoColor' # Use this ONLY for developer debugging (keep commented out for release) #color_scheme = 'Linux'   # dbg try : rptdir = self . app . ipython_dir except : rptdir = os . getcwd ( ) if rptdir is None or not os . path . isdir ( rptdir ) : rptdir = os . getcwd ( ) report_name = os . path . join ( rptdir , self . crash_report_fname ) # write the report filename into the instance dict so it can get # properly expanded out in the user message template self . crash_report_fname = report_name self . info [ 'crash_report_fname' ] = report_name TBhandler = ultratb . VerboseTB ( color_scheme = color_scheme , long_header = 1 , call_pdb = self . call_pdb , ) if self . call_pdb : TBhandler ( etype , evalue , etb ) return else : traceback = TBhandler . text ( etype , evalue , etb , context = 31 ) # print traceback to screen if self . show_crash_traceback : print ( traceback , file = sys . stderr ) # and generate a complete report on disk try : report = open ( report_name , 'w' ) except : print ( 'Could not create crash report on disk.' , file = sys . stderr ) return with report : # Inform user on stderr of what happened print ( '\n' + '*' * 70 + '\n' , file = sys . stderr ) print ( self . message_template . format ( * * self . info ) , file = sys . stderr ) # Construct report on disk report . write ( self . make_report ( traceback ) ) input ( "Hit <Enter> to quit (your terminal may close):" )