Skip to content

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