diff options
author | Ian Stapleton Cordasco <graffatcolmingov@gmail.com> | 2018-11-22 07:37:15 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-11-22 07:37:15 -0600 |
commit | 3d37ea0aa2e369852c98bbbcaef8a89ed00996dc (patch) | |
tree | e12db5f1f565ed291874c36eafa981009dc5b70f /pycodestyle.py | |
parent | d288c073eb3ff268bab619961253ec41f3b97201 (diff) | |
parent | 397463014fda3cdefe8d6c9d117ae16d878dc494 (diff) | |
download | pep8-3d37ea0aa2e369852c98bbbcaef8a89ed00996dc.tar.gz |
Merge pull request #801 from mwhudson/tokenizer-compat
Keep compability with stdlib tokenize.py changes
Diffstat (limited to 'pycodestyle.py')
-rwxr-xr-x | pycodestyle.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/pycodestyle.py b/pycodestyle.py index f0ae6dc..c9e1667 100755 --- a/pycodestyle.py +++ b/pycodestyle.py @@ -258,10 +258,10 @@ def trailing_blank_lines(physical_line, lines, line_number, total_lines): """ if line_number == total_lines: stripped_last_line = physical_line.rstrip() - if not stripped_last_line: + if physical_line and not stripped_last_line: return 0, "W391 blank line at end of file" if stripped_last_line == physical_line: - return len(physical_line), "W292 no newline at end of file" + return len(lines[-1]), "W292 no newline at end of file" @register_check |