Skip to content

Commit

Permalink
_Classes_ always have a __dict__
Browse files Browse the repository at this point in the history
  • Loading branch information
hynek committed Sep 2, 2020
1 parent 94922ba commit 0d06f16
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/attr/_make.py
Original file line number Diff line number Diff line change
Expand Up @@ -686,10 +686,7 @@ def _create_slots_class(self):
# Traverse the MRO to check for an existing __weakref__.
weakref_inherited = False
for base_cls in self._cls.__mro__[1:-1]:
if (
getattr(base_cls, "__dict__", {}).get("__weakref__", None)
is not None
):
if base_cls.__dict__.get("__weakref__", None) is not None:
weakref_inherited = True
break

Expand Down

0 comments on commit 0d06f16

Please sign in to comment.