summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoryushao2 <36848472+yushao2@users.noreply.github.com>2021-11-19 08:26:18 +0800
committerYu Shao, Pang <p.yushao2@gmail.com>2021-11-29 00:26:17 +0800
commitccd29745013df4c4480ca8b6ccc3e655ab2478fb (patch)
tree0c4804e8f2fc1fcd820cfec14b1d100715e2ba81
parent554801a89de6cf88382fc02290fdebb8fa0c8f04 (diff)
downloadpylint-git-ccd29745013df4c4480ca8b6ccc3e655ab2478fb.tar.gz
Apply suggestions from code review
Co-authored-by: Daniƫl van Noord <13665637+DanielNoord@users.noreply.github.com>
-rw-r--r--pylint/checkers/refactoring/recommendation_checker.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/pylint/checkers/refactoring/recommendation_checker.py b/pylint/checkers/refactoring/recommendation_checker.py
index 1c484bb59..96c04b92f 100644
--- a/pylint/checkers/refactoring/recommendation_checker.py
+++ b/pylint/checkers/refactoring/recommendation_checker.py
@@ -83,10 +83,10 @@ class RecommendationChecker(checkers.BaseChecker):
return
if node.func.attrname != "keys":
return
- comp_ancestor = utils.get_node_first_ancestor_of_type(node, nodes.Compare)
+ comp_ancestor = utils.get_node_first_ancestor_of_type(node, (nodes.Compare,))
if (
isinstance(node.parent, (nodes.For, nodes.Comprehension))
- or isinstance(comp_ancestor, nodes.Compare)
+ or comp_ancestor
and any(
op
for op, comparator in comp_ancestor.ops