Skip to content

Commit

Permalink
misc: remove with_context helper on ParseError [NFC] (#3589)
Browse files Browse the repository at this point in the history
  • Loading branch information
superlopuh authored Dec 7, 2024
1 parent fe9f649 commit 89dc7e9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
4 changes: 2 additions & 2 deletions xdsl/tools/command_line_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
3 changes: 0 additions & 3 deletions xdsl/utils/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 89dc7e9

Please sign in to comment.