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

Method get_exception_format

Lib/test/test_traceback.py:65–71  ·  view source on GitHub ↗
(self, func, exc)

Source from the content-addressed store, hash-verified

63 _colorize.COLORIZE = self.colorize
64
65 def get_exception_format(self, func, exc):
66 try:
67 func()
68 except exc as value:
69 return traceback.format_exception_only(exc, value)
70 else:
71 raise ValueError("call did not raise exception")
72
73 def syntax_error_with_caret(self):
74 compile("def fact(x):\n\treturn x!\n", "?", "exec")

Callers 3

test_caretMethod · 0.95
test_caret_wide_charMethod · 0.95
test_bad_indentationMethod · 0.95

Calls 2

format_exception_onlyMethod · 0.80
funcFunction · 0.70

Tested by

no test coverage detected