parameters: (exc=None)
docstring: Return exc (or sys.exc_info if None), formatted.
docstring_summary: Return exc (or sys.exc_info if None), formatted.
docstring_tokens: Return exc ( or sys . exc_info if None ) formatted .
function: def format_exc(exc=None):
      """Return exc (or sys.exc_info if None), formatted."""
      try:
          if exc is None:
              exc = _exc_info()
          if exc == (None, None, None):
              return ''
          import traceback
          return ''.join(traceback.format_exception(*exc))
      finally:
          del exc
function_tokens: def format_exc ( exc = None ) : try : if exc is None : exc = _exc_info ( ) if exc == ( None , None , None ) : return '' import traceback return '' . join ( traceback . format_exception ( * exc ) ) finally : del exc