Skip to content

Commit 8ae8f63

Browse files
galopyzjph00
andauthored
Condense into a line.
Co-authored-by: Jeremy Howard <j@howard.fm>
1 parent 9f6e6a8 commit 8ae8f63

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

fastcore/basics.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1046,12 +1046,7 @@ def _inner(f):
10461046
nf.__qualname__ = f"{c_.__name__}.{nm}"
10471047
if cls_method: setattr(c_, nm, _clsmethod(nf))
10481048
else:
1049-
if set_prop:
1050-
if isinstance(getattr(c_, nm, None), property):
1051-
prop = getattr(c_, nm)
1052-
setattr(c_, nm, prop.setter(nf))
1053-
else:
1054-
raise AttributeError(f"Cannot set property setter: {nm} is not a property of {c_}")
1049+
if set_prop: setattr(c_, nm, getattr(c_, nm).setter(nf))
10551050
elif as_prop: setattr(c_, nm, property(nf))
10561051
else:
10571052
onm = '_orig_'+nm

0 commit comments

Comments
 (0)