Skip to content

Commit 3d37ea0

Browse files
authored
Merge pull request #801 from mwhudson/tokenizer-compat
Keep compability with stdlib tokenize.py changes
2 parents d288c07 + 3974630 commit 3d37ea0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pycodestyle.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -258,10 +258,10 @@ def trailing_blank_lines(physical_line, lines, line_number, total_lines):
258258
"""
259259
if line_number == total_lines:
260260
stripped_last_line = physical_line.rstrip()
261-
if not stripped_last_line:
261+
if physical_line and not stripped_last_line:
262262
return 0, "W391 blank line at end of file"
263263
if stripped_last_line == physical_line:
264-
return len(physical_line), "W292 no newline at end of file"
264+
return len(lines[-1]), "W292 no newline at end of file"
265265

266266

267267
@register_check

0 commit comments

Comments
 (0)