PY-13061 Getter signature should be self: false positive for properties with other decorators

This commit is contained in:
Ilya.Kazakevich
2014-10-15 20:04:39 +04:00
parent 7381642810
commit 5d2bdd45b1
@@ -586,7 +586,7 @@ def restore_clr(p_name, p_class):
if p_name == '__new__':
methods = [c for c in clr_type.GetConstructors()]
if not methods:
return False, p_name + '(*args)', 'cannot find CLR constructor'
return False, p_name + '(self, *args)', 'cannot find CLR constructor' # "self" is always first argument of any non-static method
else:
methods = [m for m in clr_type.GetMethods() if m.Name == p_name]
if not methods:
@@ -594,7 +594,8 @@ def restore_clr(p_name, p_class):
if len(bases) == 1 and p_name in dir(bases[0]):
# skip inherited methods
return False, None, None
return False, p_name + '(*args)', 'cannot find CLR method'
return False, p_name + '(self, *args)', 'cannot find CLR method'
# "self" is always first argument of any non-static method
parameter_lists = []
for m in methods: