diff options
author | cpopa <devnull@localhost> | 2013-09-26 12:59:31 +0300 |
---|---|---|
committer | cpopa <devnull@localhost> | 2013-09-26 12:59:31 +0300 |
commit | 1bb6191104766fcdacb31213c1817c46c615a841 (patch) | |
tree | 22b491924473b6d0973037775d1657506c973ff8 /checkers/classes.py | |
parent | 3dffa20f8c99a67a1b8eab5eb9b5da77ef96f38a (diff) | |
download | pylint-1bb6191104766fcdacb31213c1817c46c615a841.tar.gz |
Fix argument check for variable arguments.
Diffstat (limited to 'checkers/classes.py')
-rw-r--r-- | checkers/classes.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/checkers/classes.py b/checkers/classes.py index 7ced271..fd76146 100644 --- a/checkers/classes.py +++ b/checkers/classes.py @@ -353,7 +353,10 @@ a metaclass class method.'} def _check_exit(self, node): positional = sum(1 for arg in node.args.args if arg.name != 'self') - if positional != 3 and not node.args.vararg: + if positional < 3 and not node.args.vararg: + self.add_message('bad-context-manager', + node=node) + elif positional > 3: self.add_message('bad-context-manager', node=node) |