MCPcopy Index your code
hub / github.com/RustPython/RustPython / get_exception_format

Method get_exception_format

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

Source from the content-addressed store, hash-verified

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

Callers 2

test_caretMethod · 0.95
test_bad_indentationMethod · 0.95

Calls 2

format_exception_onlyMethod · 0.80
funcFunction · 0.70

Tested by

no test coverage detected