diff options
author | Emile Anclin <emile.anclin@logilab.fr> | 2010-11-10 14:20:59 +0100 |
---|---|---|
committer | Emile Anclin <emile.anclin@logilab.fr> | 2010-11-10 14:20:59 +0100 |
commit | de8216178228ed027f140300bf0c698cc59c8090 (patch) | |
tree | cbfb6fb75c7faebacb1aca1447e9348b0e8ac8a2 | |
parent | 1e44813300c240910bb62b09de8763b79444a2b9 (diff) | |
download | pylint-git-de8216178228ed027f140300bf0c698cc59c8090.tar.gz |
fix: raise NotImplemented with a callfunc is also bad
-rw-r--r-- | checkers/exceptions.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/checkers/exceptions.py b/checkers/exceptions.py index f4271f10b..3e95bf02e 100644 --- a/checkers/exceptions.py +++ b/checkers/exceptions.py @@ -109,7 +109,10 @@ class ExceptionsChecker(BaseChecker): isinstance(expr, (astng.List, astng.Dict, astng.Tuple, astng.Module, astng.Function)): self.add_message('E0702', node=node, args=expr.name) - elif isinstance(expr, astng.Name) and expr.name == 'NotImplemented': + elif ( (isinstance(expr, astng.Name) and expr.name == 'NotImplemented') + or (isinstance(expr, astng.CallFunc) and + isinstance(expr.func, astng.Name) and + expr.func.name == 'NotImplemented') ): self.add_message('E0711', node=node) elif isinstance(expr, astng.BinOp) and expr.op == '%': self.add_message('W0701', node=node) |