Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions src/attr/_make.py
Original file line number Diff line number Diff line change
Expand Up @@ -2014,11 +2014,13 @@ def _make_init_script(
attr_dict[a.name] = a

if a.on_setattr is not None:
if frozen is True:
if a.on_setattr is setters.NO_OP:
pass
elif frozen is True:
msg = "Frozen classes can't use on_setattr."
raise ValueError(msg)

needs_cached_setattr = True
else:
needs_cached_setattr = True
elif has_cls_on_setattr and a.on_setattr is not setters.NO_OP:
needs_cached_setattr = True

Expand Down
Loading