MCPcopy Index your code
hub / github.com/python/cpython / formatException

Method formatException

Lib/logging/__init__.py:658–675  ·  view source on GitHub ↗

Format and return the specified exception information as a string. This default implementation just uses traceback.print_exception()

(self, ei)

Source from the content-addressed store, hash-verified

656 return s
657
658 def formatException(self, ei):
659 """
660 Format and return the specified exception information as a string.
661
662 This default implementation just uses
663 traceback.print_exception()
664 """
665 sio = io.StringIO()
666 tb = ei[2]
667 # See issues #9427, #1553375. Commented out for now.
668 #if getattr(self, 'fullstack', False):
669 # traceback.print_stack(tb.tb_frame.f_back, file=sio)
670 traceback.print_exception(ei[0], ei[1], tb, limit=None, file=sio)
671 s = sio.getvalue()
672 sio.close()
673 if s[-1:] == "\n":
674 s = s[:-1]
675 return s
676
677 def usesTime(self):
678 """

Callers 1

formatMethod · 0.95

Calls 2

getvalueMethod · 0.95
closeMethod · 0.45

Tested by

no test coverage detected