Skip to content

Commit 5f9e15a

Browse files
committed
Only note if the replacement is also a Decorator
1 parent 6c45c3f commit 5f9e15a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mypy/semanal.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7157,7 +7157,7 @@ def already_defined(
71577157
self.fail(
71587158
f'{noun} "{unmangle(name)}" already defined{extra_msg}', ctx, code=codes.NO_REDEF
71597159
)
7160-
if isinstance(node, Decorator) and node.func.is_property:
7160+
if isinstance(ctx, Decorator) and isinstance(node, Decorator) and node.func.is_property:
71617161
self.note("Property setter and deleter must be adjacent to the getter.", ctx)
71627162

71637163
def name_already_defined(

0 commit comments

Comments
 (0)