summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Wang <mattwyl@gmail.com>2013-02-25 22:08:30 +0800
committerMatthew Wang <mattwyl@gmail.com>2013-02-25 22:29:25 +0800
commit9aac3c0685843b8c1c204a83354de89f0c13979a (patch)
tree493cc32bb49f386d00da20efbaf966af316c353a
parentc2762148742ac9dba4f3ea2acaad6b5dd8be62f0 (diff)
downloadpep8-9aac3c0685843b8c1c204a83354de89f0c13979a.tar.gz
Fix misleading error message for E251
-rwxr-xr-xpep8.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/pep8.py b/pep8.py
index f9ca8e6..f06d275 100755
--- a/pep8.py
+++ b/pep8.py
@@ -751,12 +751,12 @@ def whitespace_around_named_parameter_equals(logical_line, tokens):
parens = 0
no_space = False
prev_end = None
+ message = "E251 unexpected spaces around keyword / parameter equals"
for token_type, text, start, end, line in tokens:
if no_space:
no_space = False
if start != prev_end:
- yield (prev_end,
- "E251 no spaces around keyword / parameter equals")
+ yield (prev_end, message)
elif token_type == tokenize.OP:
if text == '(':
parens += 1
@@ -765,8 +765,7 @@ def whitespace_around_named_parameter_equals(logical_line, tokens):
elif parens and text == '=':
no_space = True
if start != prev_end:
- yield (prev_end,
- "E251 no spaces around keyword / parameter equals")
+ yield (prev_end, message)
prev_end = end