summaryrefslogtreecommitdiff
path: root/pylint/checkers/classes.py
diff options
context:
space:
mode:
authorClaudiu Popa <cpopa@cloudbasesolutions.com>2015-05-14 11:34:14 +0300
committerClaudiu Popa <cpopa@cloudbasesolutions.com>2015-05-14 11:34:14 +0300
commit57ff20b24c208a201002ea6ec790fb36bbf766d5 (patch)
tree9cf50084a2581a6068ade5163c3fe148ad651c25 /pylint/checkers/classes.py
parent62f40c65ee8c1f5283b343ca23a6efb76b283633 (diff)
downloadpylint-git-57ff20b24c208a201002ea6ec790fb36bbf766d5.tar.gz
Remove 'bad-context-manager' due to the inclusion of 'unexpected-special-method-signature'.
Diffstat (limited to 'pylint/checkers/classes.py')
-rw-r--r--pylint/checkers/classes.py21
1 files changed, 2 insertions, 19 deletions
diff --git a/pylint/checkers/classes.py b/pylint/checkers/classes.py
index c63a79ac5..71a589ee2 100644
--- a/pylint/checkers/classes.py
+++ b/pylint/checkers/classes.py
@@ -198,11 +198,6 @@ MSGS = {
'non-parent-init-called',
'Used when an __init__ method is called on a class which is not '
'in the direct ancestors for the analysed class.'),
- 'E0235': ('__exit__ must accept 3 arguments: type, value, traceback',
- 'bad-context-manager',
- 'Used when the __exit__ special method, belonging to a '
- 'context manager, does not accept 3 arguments '
- '(type, value, traceback).'),
'E0236': ('Invalid object %r in __slots__, must contain '
'only non empty strings',
'invalid-slots-object',
@@ -448,9 +443,6 @@ a metaclass class method.'}
except astroid.NotFoundError:
pass
- if node.name == '__exit__':
- self._check_exit(node)
-
def _check_slots(self, node):
if '__slots__' not in node.locals:
return
@@ -501,16 +493,6 @@ a metaclass class method.'}
args=infered.as_string(),
node=elt)
-
- 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:
- self.add_message('bad-context-manager',
- node=node)
- elif positional > 3:
- self.add_message('bad-context-manager',
- node=node)
-
def leave_function(self, node):
"""on method node, check if this method couldn't be a function
@@ -897,7 +879,8 @@ class SpecialMethodsChecker(BaseChecker):
'unexpected-special-method-signature',
'Emitted when a special method was defined with an '
'invalid number of parameters. If it has too few or '
- 'too many, it might not work at all.'),
+ 'too many, it might not work at all.',
+ {'old_names': [('E0235', 'bad-context-manager')]}),
}
priority = -2