Skip to content

Fix missing __dict__#2685

Merged
Pierre-Sassoulas merged 1 commit intopylint-dev:mainfrom
sbrunner:missing-dict
Feb 24, 2025
Merged

Fix missing __dict__#2685
Pierre-Sassoulas merged 1 commit intopylint-dev:mainfrom
sbrunner:missing-dict

Conversation

@sbrunner
Copy link
Contributor

Type of Changes

Type
🐛 Bug fix

Description

No crash when the object didn't have an attribute __dict__

Refs pylint-dev/pylint#10223

@codecov
Copy link

codecov bot commented Feb 13, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 93.19%. Comparing base (fe893d9) to head (b912202).
Report is 65 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #2685   +/-   ##
=======================================
  Coverage   93.19%   93.19%           
=======================================
  Files          93       93           
  Lines       11066    11069    +3     
=======================================
+ Hits        10313    10316    +3     
  Misses        753      753           
Flag Coverage Δ
linux 93.08% <100.00%> (+<0.01%) ⬆️
pypy 93.19% <100.00%> (+<0.01%) ⬆️
windows 93.19% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
astroid/raw_building.py 94.58% <100.00%> (+0.05%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Collaborator

@DanielNoord DanielNoord left a comment

Choose a reason for hiding this comment

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

Do you mind adding a test for this?

Possibly by calling del on something with a __dict__ attribute.

@sbrunner sbrunner force-pushed the missing-dict branch 4 times, most recently from 199ce1c to ce259c0 Compare February 18, 2025 09:58
@sbrunner
Copy link
Contributor Author

I just added a test but with the mypy exception because it's not possible to delete the dict attribute on an exception!

Copy link
Member

@Pierre-Sassoulas Pierre-Sassoulas left a comment

Choose a reason for hiding this comment

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

LGTM thank you for opening the issue and following up @sbrunner !

Copy link
Collaborator

@DanielNoord DanielNoord left a comment

Choose a reason for hiding this comment

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

Thanks!

@sbrunner
Copy link
Contributor Author

When is it planned to be merged and released?

@Pierre-Sassoulas Pierre-Sassoulas merged commit eed7458 into pylint-dev:main Feb 24, 2025
20 checks passed
@github-actions
Copy link
Contributor

The backport to maintenance/3.3.x failed:

The process '/usr/bin/git' failed with exit code 1

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.3.x maintenance/3.3.x
# Navigate to the new working tree
cd .worktrees/backport-maintenance/3.3.x
# Create a new branch
git switch --create backport-2685-to-maintenance/3.3.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 eed745859f1242e300de597e5050433e62adcbfe
# Push it to GitHub
git push --set-upstream origin backport-2685-to-maintenance/3.3.x
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-maintenance/3.3.x

Then, create a pull request where the base branch is maintenance/3.3.x and the compare/head branch is backport-2685-to-maintenance/3.3.x.

@Pierre-Sassoulas
Copy link
Member

Thanks for the reminder @sbrunner ! We'll backport and release in the next patch version

@sbrunner
Copy link
Contributor Author

Excellent, thanks @Pierre-Sassoulas :-)

@Pierre-Sassoulas
Copy link
Member

Maybe only in 4.0.0 as the cherry-pick is a little tricky #2690 .

jacobtylerwalls pushed a commit that referenced this pull request Mar 2, 2025
jacobtylerwalls pushed a commit that referenced this pull request Mar 2, 2025
Co-authored-by: Stéphane Brunner <stephane.brunner@camptocamp.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants