summaryrefslogtreecommitdiff
path: root/checkers/variables.py
diff options
context:
space:
mode:
Diffstat (limited to 'checkers/variables.py')
-rw-r--r--checkers/variables.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/checkers/variables.py b/checkers/variables.py
index 454fc9c..f17c940 100644
--- a/checkers/variables.py
+++ b/checkers/variables.py
@@ -380,7 +380,8 @@ builtins. Remember that you should avoid to define new builtins when possible.'
if defstmt is stmt and isinstance(node, (astng.DelName,
astng.AssName)):
self.add_message('E0602', args=name, node=node)
- else:
+ elif self._to_consume[-1][-1] != 'lambda':
+ # E0601 may *not* occurs in lambda scope
self.add_message('E0601', args=name, node=node)
if not isinstance(node, astng.AssName): # Aug AssName
del to_consume[name]