summaryrefslogtreecommitdiff
path: root/pycodestyle.py
diff options
context:
space:
mode:
Diffstat (limited to 'pycodestyle.py')
-rwxr-xr-xpycodestyle.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/pycodestyle.py b/pycodestyle.py
index 0d725d2..fbc3dca 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