MCPcopy
hub / github.com/mne-tools/mne-python / _explain_exception

Function _explain_exception

mne/utils/_testing.py:26–33  ·  view source on GitHub ↗

Explain an exception.

(start=-1, stop=None, prefix="> ")

Source from the content-addressed store, hash-verified

24
25
26def _explain_exception(start=-1, stop=None, prefix="> "):
27 """Explain an exception."""
28 # start=-1 means "only the most recent caller"
29 etype, value, tb = sys.exc_info()
30 string = traceback.format_list(traceback.extract_tb(tb)[start:stop])
31 string = "".join(string).split("\n") + traceback.format_exception_only(etype, value)
32 string = ":\n" + prefix + ("\n" + prefix).join(string)
33 return string
34
35
36class _TempDir(str):

Callers

nothing calls this directly

Calls 1

splitMethod · 0.80

Tested by

no test coverage detected