-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Fix a crash when a subclass extends __slots__
#9817
Conversation
slots_names: list[str] = [] | ||
try: | ||
inferred_slots = tuple(node.ilookup("__slots__")) | ||
except astroid.InferenceError: # pragma: no cover |
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.
This is no-covered because the calls to this function are (currently) guarded by _has_valid_slots()
, which does the same test, but just adding safety because we shouldn't be failing to catch InferenceError from calls to the inference system.
π€ According to the primer, this change has no effect on the checked open source code. π€π This comment was generated for commit fcf9cf4 |
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.
Great!
The backport to
To backport manually, run these commands in your terminal: # Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-maintenance/3.2.x maintenance/3.2.x
# Navigate to the new working tree
cd .worktrees/backport-maintenance/3.2.x
# Create a new branch
git switch --create backport-9817-to-maintenance/3.2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 8e18fc012a5fcbd6cfe2b719e35ecd995da9f4bf
# Push it to GitHub
git push --set-upstream origin backport-9817-to-maintenance/3.2.x
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-maintenance/3.2.x Then, create a pull request where the |
(cherry picked from commit 8e18fc0)
(cherry picked from commit 8e18fc0)
Codecov ReportAll modified and coverable lines are covered by tests β
Additional details and impacted files@@ Coverage Diff @@
## main #9817 +/- ##
=======================================
Coverage 95.79% 95.79%
=======================================
Files 174 174
Lines 18902 18912 +10
=======================================
+ Hits 18107 18117 +10
Misses 795 795
|
Type of Changes
Description
Closes #9814