diff options
author | Claudiu Popa <pcmanticore@gmail.com> | 2015-04-02 17:13:07 +0300 |
---|---|---|
committer | Claudiu Popa <pcmanticore@gmail.com> | 2015-04-02 17:13:07 +0300 |
commit | e753a21c82b0b247644d422c99ae0752518a1e4e (patch) | |
tree | 5a13b234b7d7a83cfd9f5f481bcddc6bfc79ecbe /pylint/checkers/exceptions.py | |
parent | 05e723db5178fd7d49de3ec19e8b0bb28871a988 (diff) | |
parent | a018224550059ab7144f5e504943a37196c36d34 (diff) | |
download | pylint-e753a21c82b0b247644d422c99ae0752518a1e4e.tar.gz |
Merged in raduciorba/pylint/unused-import (pull request #244)
#475 fix unused-import false positive when the import is used in a class assignment
Diffstat (limited to 'pylint/checkers/exceptions.py')
-rw-r--r-- | pylint/checkers/exceptions.py | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/pylint/checkers/exceptions.py b/pylint/checkers/exceptions.py index d4c1746..b11a120 100644 --- a/pylint/checkers/exceptions.py +++ b/pylint/checkers/exceptions.py @@ -22,7 +22,6 @@ from logilab.common.compat import builtins from pylint.checkers import BaseChecker from pylint.checkers.utils import ( - is_empty, is_raising, check_messages, inherit_from_std_ex, @@ -91,10 +90,6 @@ MSGS = { 'broad-except', 'Used when an except catches a too general exception, \ possibly burying unrelated errors.'), - 'W0704': ('Except doesn\'t do anything', - 'pointless-except', - 'Used when an except clause does nothing but "pass" and there is\ - no "else" clause.'), 'W0705': ('Catching previously caught exception type %s', 'duplicate-except', 'Used when an except catches a type that was already caught by ' @@ -272,7 +267,7 @@ class ExceptionsChecker(BaseChecker): node=handler.type, args=(exc.name, )) - @check_messages('bare-except', 'broad-except', 'pointless-except', + @check_messages('bare-except', 'broad-except', 'binary-op-exception', 'bad-except-order', 'catching-non-exception') def visit_tryexcept(self, node): @@ -280,10 +275,6 @@ class ExceptionsChecker(BaseChecker): exceptions_classes = [] nb_handlers = len(node.handlers) for index, handler in enumerate(node.handlers): - # single except doing nothing but "pass" without else clause - if is_empty(handler.body) and not node.orelse: - self.add_message('pointless-except', - node=handler.type or handler.body[0]) if handler.type is None: if not is_raising(handler.body): self.add_message('bare-except', node=handler) |