Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Trailing comma
  • Loading branch information
ShaharNaveh committed May 19, 2026
commit 97a56598006af0b9ccb41b0c5b0a1c7e5eb45a34
4 changes: 2 additions & 2 deletions Lib/test/test_syntax.py
Original file line number Diff line number Diff line change
Expand Up @@ -2001,11 +2001,11 @@
Traceback (most recent call last):
SyntaxError: invalid syntax. Maybe you meant '==' or ':=' instead of '='?

>>> from t import x, # TODO: RUSTPYTHON; Wrong error message # doctest: +EXPECTED_FAILURE
>>> from t import x,
Traceback (most recent call last):
SyntaxError: trailing comma not allowed without surrounding parentheses

>>> from t import x,y, # TODO: RUSTPYTHON; Wrong error message # doctest: +EXPECTED_FAILURE
>>> from t import x,y,
Traceback (most recent call last):
SyntaxError: trailing comma not allowed without surrounding parentheses

Expand Down
8 changes: 7 additions & 1 deletion crates/vm/src/vm/vm_new.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,11 +141,17 @@ impl SyntaxErrorInfo {
}

ParseErrorType::OtherError(s)
if s.eq_ignore_ascii_case("Boolean 'not' expression cannot be used here") =>
if s.eq_ignore_ascii_case("boolean 'not' expression cannot be used here") =>
{
"'not' after an operator must be parenthesized".into()
}

ParseErrorType::OtherError(s)
if s.eq_ignore_ascii_case("trailing comma not allowed") =>
{
"trailing comma not allowed without surrounding parentheses".into()
}

_ => {
dbg!(error);
return;
Expand Down