Skip to content

Commit

Permalink
Fix missing __dict__
Browse files Browse the repository at this point in the history
  • Loading branch information
sbrunner committed Feb 13, 2025
1 parent 7318c43 commit d0dceae
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion astroid/raw_building.py
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,11 @@ def _base_class_object_build(
# this at least resolves common case such as Exception.args,
# OSError.errno
if issubclass(member, Exception):
instdict = member().__dict__
member_object = member()
if hasattr(member_object, "__dict__"):
instdict = member_object.__dict__
else:
raise TypeError

Check warning on line 376 in astroid/raw_building.py

View check run for this annotation

Codecov / codecov/patch

astroid/raw_building.py#L376

Added line #L376 was not covered by tests
else:
raise TypeError
except TypeError:
Expand Down

0 comments on commit d0dceae

Please sign in to comment.