summaryrefslogtreecommitdiff
path: root/checkers/variables.py
diff options
context:
space:
mode:
authorSylvain Thénault <sylvain.thenault@logilab.fr>2009-03-24 11:28:33 +0100
committerSylvain Thénault <sylvain.thenault@logilab.fr>2009-03-24 11:28:33 +0100
commitdda02ab2e5faf3ae2401925f46f7a6840ecb8afc (patch)
treebd070dee21e519b57eff8b324278686a682a4653 /checkers/variables.py
parentaf04a907a2a084ec18cbb8e28552ceafd7dbb95c (diff)
downloadpylint-git-dda02ab2e5faf3ae2401925f46f7a6840ecb8afc.tar.gz
only skip E0602 when catched by a NameError or parent
Diffstat (limited to 'checkers/variables.py')
-rw-r--r--checkers/variables.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/checkers/variables.py b/checkers/variables.py
index 14360f500..881ce9cf3 100644
--- a/checkers/variables.py
+++ b/checkers/variables.py
@@ -347,7 +347,7 @@ builtins. Remember that you should avoid to define new builtins when possible.'
self._loopvar_name(node, name)
break
# mark the name as consumed if it's defined in this scope
- # (i.e. no KeyError is raised by "to_consume[name]"
+ # (i.e. no KeyError is raised by "to_consume[name]")
try:
consumed[name] = to_consume[name]
except KeyError:
@@ -377,7 +377,7 @@ builtins. Remember that you should avoid to define new builtins when possible.'
if (maybee0601
and stmt.fromlineno <= defstmt.fromlineno
and not is_defined_before(node)
- and not are_exclusive(stmt, defstmt)):
+ and not are_exclusive(stmt, defstmt, ('NameError', 'Exception', 'BaseException'))):
if defstmt is stmt and isinstance(node, (astng.DelName,
astng.AssName)):
self.add_message('E0602', args=name, node=node)