Skip to content

Commit a925fe4

Browse files
committed
Change the position pointed out by W504
1 parent d8f10a9 commit a925fe4

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
@@ -1266,15 +1266,16 @@ def break_after_binary_operator(logical_line, tokens):
12661266
Okay: var = (1 /\n -2)
12671267
Okay: var = (1 +\n -1 +\n -2)
12681268
"""
1269+
old_start = None
12691270
for context in _break_around_binary_operators(tokens):
12701271
(token_type, text, previous_token_type, previous_text,
12711272
line_break, unary_context, start) = context
12721273
if (_is_binary_operator(previous_token_type, previous_text) and
12731274
line_break and
12741275
not unary_context and
12751276
not _is_binary_operator(token_type, text)):
1276-
error_pos = (start[0] - 1, start[1])
1277-
yield error_pos, "W504 line break after binary operator"
1277+
yield old_start, "W504 line break after binary operator"
1278+
old_start = start
12781279

12791280

12801281
@register_check

0 commit comments

Comments
 (0)