Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unskip testTrailingCommaParsing test #13484

Merged
merged 1 commit into from
Aug 23, 2022

Conversation

sobolevn
Copy link
Member

@sobolevn sobolevn commented Aug 23, 2022

The first test right now passes.

But, the second one is not valid Python:

>>> if x in 1, : pass
  File "<stdin>", line 1
    if x in 1, : pass
             ^
SyntaxError: invalid syntax

And:

>>> import ast
>>> ast.dump(ast.parse('if x in 1, : pass'))
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/sobolev/.pyenv/versions/3.8.9/lib/python3.8/ast.py", line 47, in parse
    return compile(source, filename, mode, flags,
  File "<unknown>", line 1
    if x in 1, : pass
             ^
SyntaxError: invalid syntax

So, we must raise a correct syntax error for it.

@JukkaL JukkaL merged commit a50c9ff into python:master Aug 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants