Skip to content

Commit 5b30d91

Browse files
Further simplification
1 parent d0f2939 commit 5b30d91

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

pylint/checkers/utils.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -873,10 +873,9 @@ def decorated_with(
873873
decorator_node = decorator_node.func
874874
try:
875875
if any(
876-
(hasattr(i, "name") and i.name in qnames)
877-
or (hasattr(i, "qname") and i.qname() in qnames)
876+
i.name in qnames or i.qname() in qnames
878877
for i in decorator_node.infer()
879-
if i is not None and not isinstance(i, util.UninferableBase)
878+
if isinstance(i, (nodes.ClassDef, nodes.FunctionDef))
880879
):
881880
return True
882881
except astroid.InferenceError:

0 commit comments

Comments
 (0)