Return the error message as string if compiling `expr` fails.
(self, expr)
| 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 |
no test coverage detected