summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Miller <mike@mtmxr.com>2016-06-03 10:02:08 -0700
committerMike Miller <mike@mtmxr.com>2016-06-03 10:02:08 -0700
commit017d3b5da0c37bd48df3778752bfa98b4eed6d5e (patch)
tree88c9f70168f6a9801893c6c105ccba95f1ce8251
parent4c8152c7da74d7f7e20d3ae98b52581ef1b0f16b (diff)
downloadpep8-017d3b5da0c37bd48df3778752bfa98b4eed6d5e.tar.gz
Also report E741 on 'global' and 'nonlocal' statements
-rwxr-xr-xpycodestyle.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/pycodestyle.py b/pycodestyle.py
index 38648a3..f92d860 100755
--- a/pycodestyle.py
+++ b/pycodestyle.py
@@ -1180,8 +1180,8 @@ def ambiguous_identifier(logical_line, tokens):
if prev_text in idents_to_avoid:
ident = prev_text
pos = prev_start
- # identifiers after 'as'
- if prev_text == 'as':
+ # identifiers bound to a value with 'as', 'global', or 'nonlocal'
+ if prev_text in ('as', 'global', 'nonlocal'):
if text in idents_to_avoid:
ident = text
pos = start