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

Method _compile_error_message

Lib/pdb.py:2595–2601  ·  view source on GitHub ↗

Return the error message as string if compiling `expr` fails.

(self, expr)

Source from the content-addressed store, hash-verified

2593 return traceback.format_exception_only(exc)[-1].strip()
2594
2595 def _compile_error_message(self, expr):
2596 """Return the error message as string if compiling `expr` fails."""
2597 try:
2598 compile(expr, "<stdin>", "eval")
2599 except SyntaxError as exc:
2600 return _rstr(self._format_exc(exc))
2601 return ""
2602
2603 def _getsourcelines(self, obj):
2604 # GH-103319

Callers 3

do_breakMethod · 0.95
do_conditionMethod · 0.95
do_displayMethod · 0.95

Calls 3

_format_excMethod · 0.95
_rstrClass · 0.85
compileFunction · 0.70

Tested by

no test coverage detected