aboutsummaryrefslogtreecommitdiffstats
path: root/debian/lib/python/debian_linux/utils.py
diff options
context:
space:
mode:
authorBen Hutchings <ben@decadent.org.uk>2018-10-01 16:22:49 +0100
committerBen Hutchings <ben@decadent.org.uk>2018-10-01 21:41:23 +0100
commitaf0098b10aadcfd31fb8ab3cb23c2e41f82e9cc5 (patch)
tree8ab7905f109fa94da57a3af6ac877a67e7ea8c20 /debian/lib/python/debian_linux/utils.py
parent79ecbb0832fa2f858bef961cc8412b7c8a279787 (diff)
downloadkernel_replicant_linux-af0098b10aadcfd31fb8ab3cb23c2e41f82e9cc5.tar.gz
kernel_replicant_linux-af0098b10aadcfd31fb8ab3cb23c2e41f82e9cc5.tar.bz2
kernel_replicant_linux-af0098b10aadcfd31fb8ab3cb23c2e41f82e9cc5.zip
debian/bin, debian/lib/python: Fix most errors reported by pycodestyle
Fix coding style violations reported by pycodestyle. This is mostly a matter of reformatting code, particularly to eliminate over-long lines. I also rename one variable ("l" is considered visually ambiguous) and change a bare "except" to explicitly catch all exceptions. There are three types of error or warning remaining: - debian/bin/...: E402 module level import not at top of file Scripts in debian/bin need to modify the import path before importing from debian/lib/python. - E127 continuation line over-indented for visual indent This seems to be a false positive. pycodestyle doesn't seem to be happy with any level of indent (including 0) on a continuation line in a "with" statement. - debian/lib/python/debian_linux/debian.py:15:2: W291 trailing whitespace This is a false positive. The trailing spaces are in a long string and are intentional.
Diffstat (limited to 'debian/lib/python/debian_linux/utils.py')
-rw-r--r--debian/lib/python/debian_linux/utils.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/debian/lib/python/debian_linux/utils.py b/debian/lib/python/debian_linux/utils.py
index 5d6a7d473066..34c15536df05 100644
--- a/debian/lib/python/debian_linux/utils.py
+++ b/debian/lib/python/debian_linux/utils.py
@@ -44,10 +44,12 @@ def read_control(f):
from .debian import Package
return _read_rfc822(f, Package)
+
def read_tests_control(f):
from .debian import TestsControl
return _read_rfc822(f, TestsControl)
+
def _read_rfc822(f, cls):
entries = []
eof = False
@@ -69,14 +71,16 @@ def _read_rfc822(f, cls):
break
if line[0] in ' \t':
if not last:
- raise ValueError('Continuation line seen before first header')
+ raise ValueError(
+ 'Continuation line seen before first header')
lines.append(line.lstrip())
continue
if last:
e[last] = '\n'.join(lines)
i = line.find(':')
if i < 0:
- raise ValueError(u"Not a header, not a continuation: ``%s''" % line)
+ raise ValueError(u"Not a header, not a continuation: ``%s''" %
+ line)
last = line[:i]
lines = [line[i + 1:].lstrip()]
if last: