diff options
| author | Claudiu Popa <cpopa@cloudbasesolutions.com> | 2015-01-12 21:29:27 +0200 |
|---|---|---|
| committer | Claudiu Popa <cpopa@cloudbasesolutions.com> | 2015-01-12 21:29:27 +0200 |
| commit | c4e33851523d13a7359681f754c8cf63fbf44b6f (patch) | |
| tree | 731475c45e57d2bea0f3dcbdf122a0096fd382e4 /checkers/stdlib.py | |
| parent | a2854ec66e8f92917a8b279552f1d4bc8b67a81f (diff) | |
| download | pylint-git-c4e33851523d13a7359681f754c8cf63fbf44b6f.tar.gz | |
Check the number of arguments before attempting to obtain the first one.
Diffstat (limited to 'checkers/stdlib.py')
| -rw-r--r-- | checkers/stdlib.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/checkers/stdlib.py b/checkers/stdlib.py index 216d640d5..b6b802623 100644 --- a/checkers/stdlib.py +++ b/checkers/stdlib.py @@ -134,7 +134,7 @@ class StdlibChecker(BaseChecker): def _check_redundant_assert(self, node, infer): if (isinstance(infer, astroid.BoundMethod) and - isinstance(node.args[0], astroid.Const) and + node.args and isinstance(node.args[0], astroid.Const) and infer.name in ['assertTrue', 'assertFalse']): self.add_message('redundant-unittest-assert', args=(infer.name, node.args[0].value, ), |
