summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhhatto <hhatto.jp@gmail.com>2018-04-14 23:17:27 +0900
committerhhatto <hhatto.jp@gmail.com>2018-04-14 23:17:27 +0900
commita925fe4c1aee5e13a9846162b46852ea471cc497 (patch)
tree2233d27eb9d9a67af2432c83fb42641a6f222fc6
parentd8f10a90e7ec93221d03b414b105f9514c469ad2 (diff)
downloadpep8-a925fe4c1aee5e13a9846162b46852ea471cc497.tar.gz
Change the position pointed out by W504
-rwxr-xr-xpycodestyle.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/pycodestyle.py b/pycodestyle.py
index dc86d30..261856b 100755
--- a/pycodestyle.py
+++ b/pycodestyle.py
@@ -1266,6 +1266,7 @@ def break_after_binary_operator(logical_line, tokens):
Okay: var = (1 /\n -2)
Okay: var = (1 +\n -1 +\n -2)
"""
+ old_start = None
for context in _break_around_binary_operators(tokens):
(token_type, text, previous_token_type, previous_text,
line_break, unary_context, start) = context
@@ -1273,8 +1274,8 @@ def break_after_binary_operator(logical_line, tokens):
line_break and
not unary_context and
not _is_binary_operator(token_type, text)):
- error_pos = (start[0] - 1, start[1])
- yield error_pos, "W504 line break after binary operator"
+ yield old_start, "W504 line break after binary operator"
+ old_start = start
@register_check