-
-
Notifications
You must be signed in to change notification settings - Fork 31.1k
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
Incorrect bad token identified in 3.10.1 #90162
Comments
In Python 3.10.1, a change occurred compared with 3.10.0 so that an incorrect token is flagged for a SyntaxError. Also, in 3.11.0a2, the suggestion made about having forgotten a comma is incorrect. Python 3.10.1 (I no longer have 3.10.0 available but I know from my tests that it was identifying correctly the wrong token.) Python 3.11.0a2 Python 3.9.5 Python 3.8.10 Python 3.7.8 Python 3.6.8 |
From (https://friendly-traceback.github.io/docs/syntax_tracebacks_en_3.10.html#for-loop-missing-in-operator), this is what was shown for Python 3.10.0 for x range(4):
^^^^^^^^^^
SyntaxError: invalid syntax. Perhaps you forgot a comma? Same as Python 3.11.0a2. |
Yeah, we are not showing that anymore as we only trigger the error when it happens inside collections to avoid many of the false positives we were seeing. This PR fixes the problem to point to the correct token, but still show "syntax error" |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: