Skip to content

Commit

Permalink
chore: improve syntax error messages (vyperlang#3885)
Browse files Browse the repository at this point in the history
This commit improves the handling of syntax errors by hiding the
underlying exception from the python parser.
  • Loading branch information
tserg authored and electriclilies committed Apr 27, 2024
1 parent cc25c71 commit ff08eae
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion vyper/ast/parse.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def parse_to_ast_with_settings(
py_ast = python_ast.parse(python_source)
except SyntaxError as e:
# TODO: Ensure 1-to-1 match of source_code:reformatted_code SyntaxErrors
raise SyntaxException(str(e), vyper_source, e.lineno, e.offset) from e
raise SyntaxException(str(e), vyper_source, e.lineno, e.offset) from None

# Add dummy function node to ensure local variables are treated as `AnnAssign`
# instead of state variables (`VariableDecl`)
Expand Down

0 comments on commit ff08eae

Please sign in to comment.