summaryrefslogtreecommitdiff
path: root/pylint/checkers/refactoring.py
diff options
context:
space:
mode:
authorClaudiu Popa <pcmanticore@gmail.com>2018-07-05 08:51:51 +0200
committerClaudiu Popa <pcmanticore@gmail.com>2018-07-05 08:51:51 +0200
commitbcae60d89690a895c5a44ebf8644dfcc317a1737 (patch)
treea5663b83e395ff8f6b1a8a30ddb5fe40df9c9f96 /pylint/checkers/refactoring.py
parent070f58010ba1605b8b9907b7cdf241734874f044 (diff)
downloadpylint-git-bcae60d89690a895c5a44ebf8644dfcc317a1737.tar.gz
Emit consider-using-get only if the target is a Name, as this is the pattern we try to detect
Close #2254
Diffstat (limited to 'pylint/checkers/refactoring.py')
-rw-r--r--pylint/checkers/refactoring.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/pylint/checkers/refactoring.py b/pylint/checkers/refactoring.py
index c7d6bfc62..c90312bd1 100644
--- a/pylint/checkers/refactoring.py
+++ b/pylint/checkers/refactoring.py
@@ -391,6 +391,7 @@ class RefactoringChecker(checkers.BaseTokenChecker):
and type_and_name_are_equal(node.body[0].value.value, node.test.ops[0][1])
and type_and_name_are_equal(node.body[0].value.slice.value, node.test.left)
and len(node.body[0].targets) == 1
+ and isinstance(node.body[0].targets[0], astroid.AssignName)
and isinstance(utils.safe_infer(node.test.ops[0][1]), astroid.Dict))
if if_block_ok and not node.orelse: