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

Function get_message_lines

Lib/idlelib/run.py:231–240  ·  view source on GitHub ↗

Return line composing the exception message.

(typ, exc, tb)

Source from the content-addressed store, hash-verified

229
230
231def get_message_lines(typ, exc, tb):
232 "Return line composing the exception message."
233 if typ in (AttributeError, NameError):
234 # 3.10+ hints are not directly accessible from python (#44026).
235 err = io.StringIO()
236 with contextlib.redirect_stderr(err):
237 sys.__excepthook__(typ, exc, tb)
238 return [err.getvalue().split("\n")[-2] + "\n"]
239 else:
240 return traceback.format_exception_only(typ, exc)
241
242
243def print_exception():

Callers 1

print_excFunction · 0.85

Calls 3

getvalueMethod · 0.95
format_exception_onlyMethod · 0.80
splitMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…