diff options
author | cpopa <devnull@localhost> | 2013-07-25 10:06:47 +0300 |
---|---|---|
committer | cpopa <devnull@localhost> | 2013-07-25 10:06:47 +0300 |
commit | 4574f4ade8560c687099443274b028d35365daff (patch) | |
tree | 3f031b4a2c31ae091ad1900a052a5a004a014732 /checkers/variables.py | |
parent | 62fb6ad894b88a5365e4641459c872b95cd481be (diff) | |
download | pylint-unpacking2.tar.gz |
Add test cases for good cases, check the targets before the inference.unpacking2
Diffstat (limited to 'checkers/variables.py')
-rw-r--r-- | checkers/variables.py | 7 |
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() |