Fix mypy failures

This commit is contained in:
Kovid Goyal 2022-03-12 08:28:43 +05:30
parent d5c48ddb94
commit ba1b3c3c2d
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 3 additions and 2 deletions

View File

@ -126,7 +126,7 @@ class PatchFile(StreamingJob):
def read_from_src(self, b: memoryview, pos: int) -> int:
self.src_file.seek(pos)
return self.src_file.readinto(b) # type: ignore
return self.src_file.readinto(b)
def close(self) -> None:
if not self.src_file.closed:

View File

@ -104,7 +104,8 @@ def layout_dimension(
) -> LayoutDimension:
number_of_windows = len(decoration_pairs)
number_of_cells = length // cell_length
space_needed_for_decorations: int = sum(map(sum, decoration_pairs))
dec_vals: Iterable[int] = map(sum, decoration_pairs)
space_needed_for_decorations = sum(dec_vals)
extra = length - number_of_cells * cell_length
while extra < space_needed_for_decorations:
number_of_cells -= 1