diff options
author | Pierre Sassoulas <pierre.sassoulas@gmail.com> | 2021-06-30 20:21:18 +0200 |
---|---|---|
committer | Pierre Sassoulas <pierre.sassoulas@gmail.com> | 2021-06-30 23:13:20 +0200 |
commit | efc35c3c40622f419ea07f698c029f13fb9fed52 (patch) | |
tree | 8da44bd55a781cc0aefef9be803a555f9e8db955 /pylint | |
parent | ac5518ac50121c88043ba45ba6fa8f7ece7430c3 (diff) | |
download | pylint-git-efc35c3c40622f419ea07f698c029f13fb9fed52.tar.gz |
[unused-private-member] Handle the 'None' case for attribute expression
Diffstat (limited to 'pylint')
-rw-r--r-- | pylint/checkers/classes.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/pylint/checkers/classes.py b/pylint/checkers/classes.py index c5d631f24..6fffd2b16 100644 --- a/pylint/checkers/classes.py +++ b/pylint/checkers/classes.py @@ -909,6 +909,8 @@ a metaclass class method.", continue for attribute in node.nodes_of_class(astroid.Attribute): attribute = cast(astroid.Attribute, attribute) + if attribute.expr is None: # attribute.expr is probably not really an Optional ? + continue if ( attribute.attrname == function_def.name and attribute.scope() != function_def # We ignore recursive calls |