-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Fix crash when a slice object is called
#10715
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
base: main
Are you sure you want to change the base?
Conversation
|
π€ According to the primer, this change has no effect on the checked open source code. π€π This comment was generated for commit 484e910 |
Codecov Reportβ
All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #10715 +/- ##
=======================================
Coverage 95.97% 95.97%
=======================================
Files 176 176
Lines 19537 19537
=======================================
Hits 18750 18750
Misses 787 787
π New features to boost your workflow:
|
prefer-typing-namedtuple and consider-math-not-float when a slice object is called.slice object is called
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's okay to pre-filter, maybe we don't have to filter anymore after that ? (It's not the first crash that the fuzzing caught by using slice instead of functiondev/classdef, maybe we can anticipate other instances of that without waiting for "random luck"). Maybe by creating a safe_infer_call function ?
| if not called: | ||
| return |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| if not called: | |
| return | |
| if not (called and isinstance(called, (nodes.FunctionDef, nodes.ClassDef))): | |
| return |
Type of Changes
Description
Add a runtime type guard before accessing
qname()on inferred called function for bothprefer-typing-namedtupleandconsider-math-not-floatchecks.Closes #10708