Skip to content

Commit 017d3b5

Browse files
committed
Also report E741 on 'global' and 'nonlocal' statements
1 parent 4c8152c commit 017d3b5

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

pycodestyle.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1180,8 +1180,8 @@ def ambiguous_identifier(logical_line, tokens):
11801180
if prev_text in idents_to_avoid:
11811181
ident = prev_text
11821182
pos = prev_start
1183-
# identifiers after 'as'
1184-
if prev_text == 'as':
1183+
# identifiers bound to a value with 'as', 'global', or 'nonlocal'
1184+
if prev_text in ('as', 'global', 'nonlocal'):
11851185
if text in idents_to_avoid:
11861186
ident = text
11871187
pos = start

0 commit comments

Comments
 (0)