summaryrefslogtreecommitdiff
path: root/checkers/classes.py
diff options
context:
space:
mode:
authorClaudiu Popa <pcmanticore@gmail.com>2013-09-26 12:59:31 +0300
committerClaudiu Popa <pcmanticore@gmail.com>2013-09-26 12:59:31 +0300
commit235cf9fc6a780c9bcc4503d0e2327cffedf58153 (patch)
tree5ea6f8936a1820d7d88a39adad30bca4e8ae697b /checkers/classes.py
parentad659add7fe07fd1d7e636bcc6f3ecef7652d5b8 (diff)
downloadpylint-git-235cf9fc6a780c9bcc4503d0e2327cffedf58153.tar.gz
Fix argument check for variable arguments.
--HG-- branch : exit_context
Diffstat (limited to 'checkers/classes.py')
-rw-r--r--checkers/classes.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/checkers/classes.py b/checkers/classes.py
index 7ced271db..fd7614634 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)