Skip to content

Commit 0364618

Browse files
authored
Merge pull request #751 from hhatto/w504-position
Change the position pointed out by W504
2 parents f4f6e55 + 7ca10fe commit 0364618

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

pycodestyle.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1279,15 +1279,16 @@ def break_after_binary_operator(logical_line, tokens):
12791279
Okay: var = (1 /\n -2)
12801280
Okay: var = (1 +\n -1 +\n -2)
12811281
"""
1282+
prev_start = None
12821283
for context in _break_around_binary_operators(tokens):
12831284
(token_type, text, previous_token_type, previous_text,
12841285
line_break, unary_context, start) = context
12851286
if (_is_binary_operator(previous_token_type, previous_text) and
12861287
line_break and
12871288
not unary_context and
12881289
not _is_binary_operator(token_type, text)):
1289-
error_pos = (start[0] - 1, start[1])
1290-
yield error_pos, "W504 line break after binary operator"
1290+
yield prev_start, "W504 line break after binary operator"
1291+
prev_start = start
12911292

12921293

12931294
@register_check

0 commit comments

Comments
 (0)