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

Handle new SyntaxError tuple on 3.10 #1374

Merged
merged 1 commit into from
Aug 15, 2021
Merged

Handle new SyntaxError tuple on 3.10 #1374

merged 1 commit into from
Aug 15, 2021

Conversation

sigmavirus24
Copy link
Member

Closes #1372

column > 0
and token
and isinstance(exception, SyntaxError)
and len(token) == 4 # Python 3.9 or earlier
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can this be >= 4 or does the physical_line bit not matter in 3.10?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So token[3] will always be the string we care about. I left it as [3] because that's probably safer than [-1] and then I realized that the offsets changed and might be more accurate on 3.10 so we probably don't need to muck with them.

Copy link
Member

@asottile asottile left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@asottile asottile merged commit 281f3f8 into master Aug 15, 2021
@asottile asottile deleted the bug/1372 branch August 15, 2021 22:28
@asottile asottile added this to the 4.0.0 milestone Oct 11, 2021
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.

AttributeError on Python 3.10
2 participants