Skip to content

Commit ecf7078

Browse files
committed
EAFP
1 parent 7bb68fb commit ecf7078

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/attr/_make.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -865,9 +865,9 @@ def _create_slots_class(self):
865865
del self._cls.__weakref__
866866

867867
# Manually bump internal version tag.
868-
if hasattr(self._cls, "__abstractmethods__"):
868+
try:
869869
self._cls.__abstractmethods__ = self._cls.__abstractmethods__
870-
else:
870+
except AttributeError:
871871
self._cls.__abstractmethods__ = frozenset({"__init__"})
872872
del self._cls.__abstractmethods__
873873

0 commit comments

Comments
 (0)