summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmile Anclin <emile.anclin@logilab.fr>2010-11-10 14:20:59 +0100
committerEmile Anclin <emile.anclin@logilab.fr>2010-11-10 14:20:59 +0100
commitde8216178228ed027f140300bf0c698cc59c8090 (patch)
treecbfb6fb75c7faebacb1aca1447e9348b0e8ac8a2
parent1e44813300c240910bb62b09de8763b79444a2b9 (diff)
downloadpylint-git-de8216178228ed027f140300bf0c698cc59c8090.tar.gz
fix: raise NotImplemented with a callfunc is also bad
-rw-r--r--checkers/exceptions.py5
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)