Python: Fix ExceptStmt::getType#6283
Merged
RasmusWL merged 3 commits intogithub:mainfrom Sep 14, 2021
Merged
Conversation
We were not supporting `except` statements handling multiple exception types (specified as a tuple) correctly, instead just returning the tuple itself as the "type" (which makes little sense). To fix this, we explicitly extract the elements of this node, in the case where it _is_ a tuple. This is a change that can potentially affect many queries (as `getType` is used in quite a few places), so some care should be taken to ensure that this does not adversely affect performance.
Contributor
Author
|
This should not be merged before it's been thoroughly vetted for performance. Ultimately, it may be desirable to only apply it on a much smaller scale. |
RasmusWL
reviewed
Jul 15, 2021
Member
RasmusWL
left a comment
There was a problem hiding this comment.
LGTM 👍 I won't approve to avoid us accidentally merging this though 😅
RasmusWL
approved these changes
Sep 14, 2021
Member
RasmusWL
left a comment
There was a problem hiding this comment.
LGTM 👍
(performance and new results both looks good to me 👍)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
We were not supporting
exceptstatements handling multiple exceptiontypes (specified as a tuple) correctly, instead just returning the
tuple itself as the "type" (which makes little sense).
To fix this, we explicitly extract the elements of this node, in the
case where it is a tuple.
This is a change that can potentially affect many queries (as
getTypeis used in quite a few places), so some care should be taken to
ensure that this does not adversely affect performance.
Fixes #6227
This is a minor change, and so probably doesn't require a change note.