Skip to content

fastparse: add line and column information for extended slices #8743

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

Merged
merged 2 commits into from
May 1, 2020

Conversation

hauntsaninja
Copy link
Collaborator

Helps with Python 3.9 test failures

if isinstance(e.index, SliceExpr):
if (
isinstance(e.index, SliceExpr) or
(sys.version_info <= (3, 9) and isinstance(e.index, TupleExpr))
Copy link
Collaborator

Choose a reason for hiding this comment

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

Does this mean that the version check is only true for versions earlier than 3.9.0 (since version_info has extra components beyond the first three) or up to 3.9.0? Please add a comment about this.

Or could you perhaps use < (3, 9) as the condition?

Copy link
Collaborator Author

@hauntsaninja hauntsaninja Apr 30, 2020

Choose a reason for hiding this comment

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

Thanks! I did mean to use the latter. Changed a couple things and added comments; hopefully the result is more understandable.

Comparison using the ast3 nodes makes things a little clearer, as does
commenting the code.
@hauntsaninja hauntsaninja requested a review from JukkaL April 30, 2020 18:14
@JukkaL JukkaL merged commit 6638ce8 into python:master May 1, 2020
@JukkaL
Copy link
Collaborator

JukkaL commented May 1, 2020

Thanks!

@gvanrossum
Copy link
Member

Oh, thanks for this fix @hauntsaninja! I had been wondering about those diff lines in the CI logs for 3.9.

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.

4 participants