summaryrefslogtreecommitdiff
path: root/pep8.py
diff options
context:
space:
mode:
authorAlex Grönholm <alex.gronholm@nextday.fi>2016-04-08 14:54:57 +0300
committerAlex Grönholm <alex.gronholm@nextday.fi>2016-04-08 18:21:42 +0300
commit4a37706b95a49ff61a44202f9775146de1e895db (patch)
tree7fcf9f27191a6438bb727f91f0d7f9e8cc006ca3 /pep8.py
parentac1e249ccb17ca67812262ccfc7c53fa9ff6f0df (diff)
downloadpep8-4a37706b95a49ff61a44202f9775146de1e895db.tar.gz
Fix false E251 error involving square brackets
Fixed a case where a comma is erroneously interpreted as an argument separator when square brackets are used in an argument annotation with a default value. Closes #496
Diffstat (limited to 'pep8.py')
-rwxr-xr-xpep8.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/pep8.py b/pep8.py
index ec19dc5..8ec21e1 100755
--- a/pep8.py
+++ b/pep8.py
@@ -794,9 +794,9 @@ def whitespace_around_named_parameter_equals(logical_line, tokens):
if start != prev_end:
yield (prev_end, message)
if token_type == tokenize.OP:
- if text == '(':
+ if text in '([':
parens += 1
- elif text == ')':
+ elif text in ')]':
parens -= 1
elif in_def and text == ':' and parens == 1:
annotated_func_arg = True