We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d0f2939 commit 5b30d91Copy full SHA for 5b30d91
pylint/checkers/utils.py
@@ -873,10 +873,9 @@ def decorated_with(
873
decorator_node = decorator_node.func
874
try:
875
if any(
876
- (hasattr(i, "name") and i.name in qnames)
877
- or (hasattr(i, "qname") and i.qname() in qnames)
+ i.name in qnames or i.qname() in qnames
878
for i in decorator_node.infer()
879
- if i is not None and not isinstance(i, util.UninferableBase)
+ if isinstance(i, (nodes.ClassDef, nodes.FunctionDef))
880
):
881
return True
882
except astroid.InferenceError:
0 commit comments