diff --git a/xdsl/tools/command_line_tool.py b/xdsl/tools/command_line_tool.py index c188bef317..111aeb4064 100644 --- a/xdsl/tools/command_line_tool.py +++ b/xdsl/tools/command_line_tool.py @@ -114,8 +114,8 @@ def parse_chunk( s = e.span e.span = Span(s.start, s.end, s.input, start_offset) if "parsing_diagnostics" in self.args and self.args.parsing_diagnostics: - print(e.with_context()) + print(e) else: - raise Exception("Failed to parse:\n" + e.with_context()) from e + raise finally: chunk.close() diff --git a/xdsl/utils/exceptions.py b/xdsl/utils/exceptions.py index c69d8484b9..d3c15d99fa 100644 --- a/xdsl/utils/exceptions.py +++ b/xdsl/utils/exceptions.py @@ -72,9 +72,6 @@ class ParseError(Exception): def __str__(self) -> str: return self.span.print_with_context(self.msg) - def with_context(self) -> str: - return self.span.print_with_context(self.msg) - @dataclass class MultipleSpansParseError(ParseError):