aboutsummaryrefslogtreecommitdiff
path: root/gnu/packages/patches/python-pycodestyle-keep-compatability-with-stdlib-tokenize.py-changes.patch
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/packages/patches/python-pycodestyle-keep-compatability-with-stdlib-tokenize.py-changes.patch')
-rw-r--r--gnu/packages/patches/python-pycodestyle-keep-compatability-with-stdlib-tokenize.py-changes.patch17
1 files changed, 17 insertions, 0 deletions
diff --git a/gnu/packages/patches/python-pycodestyle-keep-compatability-with-stdlib-tokenize.py-changes.patch b/gnu/packages/patches/python-pycodestyle-keep-compatability-with-stdlib-tokenize.py-changes.patch
new file mode 100644
index 0000000000..66185d65e9
--- /dev/null
+++ b/gnu/packages/patches/python-pycodestyle-keep-compatability-with-stdlib-tokenize.py-changes.patch
@@ -0,0 +1,17 @@
+diff --git a/pycodestyle.py b/pycodestyle.py
+index 0d725d27..fbc3dca3 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