Commit 75ea5c39 authored by Chris Lamb's avatar Chris Lamb 💬

Update code to reflect version 19.10b0 of the black source code reformatter.

parent 7d6daf7c
......@@ -103,9 +103,16 @@ CBFS_MAXIMUM_FILE_SIZE = 24 * 2 ** 20 # 24 MiB
def is_header_valid(buf, size, offset=0):
magic, version, romsize, bootblocksize, align, cbfs_offset, architecture, pad = struct.unpack_from(
'!IIIIIIII', buf, offset
)
(
magic,
version,
romsize,
bootblocksize,
align,
cbfs_offset,
architecture,
pad,
) = struct.unpack_from('!IIIIIIII', buf, offset)
return (
magic == CBFS_HEADER_MAGIC
and (
......
......@@ -56,13 +56,20 @@ def parse_entries(f):
pos = f.tell()
x['ctime'], x['ctime_nano'], x['mtime'], x['mtime_nano'], x['dev'], x[
'inode'
], x['mode'], x['uid'], x['gid'], x['size'], x['sha'], x[
'flags'
] = struct.unpack(
'>LLLLLLLLLL20sH', f.read((4 * 10) + 20 + 2)
)
(
x['ctime'],
x['ctime_nano'],
x['mtime'],
x['mtime_nano'],
x['dev'],
x['inode'],
x['mode'],
x['uid'],
x['gid'],
x['size'],
x['sha'],
x['flags'],
) = struct.unpack('>LLLLLLLLLL20sH', f.read((4 * 10) + 20 + 2))
x['path'] = f.read(x['flags'] & 0x0FFF)
......
......@@ -624,9 +624,12 @@ class SideBySideDiff:
if m:
yield from self.empty_buffer()
hunk_data = map(lambda x: x == "" and 1 or int(x), m.groups())
self.hunk_off1, self.hunk_size1, self.hunk_off2, self.hunk_size2 = (
hunk_data
)
(
self.hunk_off1,
self.hunk_size1,
self.hunk_off2,
self.hunk_size2,
) = hunk_data
self.line1, self.line2 = self.hunk_off1, self.hunk_off2
yield "H", (
self.hunk_off1,
......
......@@ -162,7 +162,7 @@ def test_dot_changes_no_differences_exclude_buildinfo(
@skip_unless_module_exists('debian.deb822')
def test_dot_changes_identical_contents_and_different_files(
dot_changes_differences_identical_contents_and_different_files
dot_changes_differences_identical_contents_and_different_files,
):
assert dot_changes_differences_identical_contents_and_different_files[0]
expected_diff = get_data(
......@@ -178,7 +178,7 @@ def test_dot_changes_identical_contents_and_different_files(
@skip_unless_module_exists('debian.deb822')
def test_dot_changes_different_contents_and_identical_files(
dot_changes_differences_different_contents_and_identical_files
dot_changes_differences_different_contents_and_identical_files,
):
assert dot_changes_differences_different_contents_and_identical_files[0]
assert dot_changes_differences_different_contents_and_identical_files[1]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment