summaryrefslogtreecommitdiff
path: root/checkers/variables.py
diff options
context:
space:
mode:
Diffstat (limited to 'checkers/variables.py')
-rw-r--r--checkers/variables.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/checkers/variables.py b/checkers/variables.py
index 367685d..ea297e5 100644
--- a/checkers/variables.py
+++ b/checkers/variables.py
@@ -545,15 +545,16 @@ builtins. Remember that you should avoid to define new builtins when possible.'
@check_messages('unbalanced-tuple-unpacking')
def visit_assign(self, node):
""" Check unbalanced tuple unpacking for assignments. """
+ if not isinstance(node.targets[0], (astroid.Tuple, astroid.List)):
+ return
+
try:
- infered = next(node.value.infer())
+ infered = node.value.infer().next()
except astroid.InferenceError:
return
if not isinstance(infered, (astroid.Tuple, astroid.List)):
return
- if not isinstance(node.targets[0], (astroid.Tuple, astroid.List)):
- return
targets = node.targets[0].itered()
values = infered.itered()