From efc35c3c40622f419ea07f698c029f13fb9fed52 Mon Sep 17 00:00:00 2001 From: Pierre Sassoulas Date: Wed, 30 Jun 2021 20:21:18 +0200 Subject: [unused-private-member] Handle the 'None' case for attribute expression --- pylint/checkers/classes.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'pylint/checkers/classes.py') 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 -- cgit v1.2.1