From de8216178228ed027f140300bf0c698cc59c8090 Mon Sep 17 00:00:00 2001 From: Emile Anclin Date: Wed, 10 Nov 2010 14:20:59 +0100 Subject: fix: raise NotImplemented with a callfunc is also bad --- checkers/exceptions.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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) -- cgit v1.2.1