From 1aec299ad89d78514f24a0cf14449af2b7c7822c Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 9 Dec 2024 21:22:41 +0530 Subject: [PATCH] ... --- kitty/fonts/render.py | 2 +- kitty_tests/fonts.py | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/kitty/fonts/render.py b/kitty/fonts/render.py index 9cbf486cb..a3c282083 100644 --- a/kitty/fonts/render.py +++ b/kitty/fonts/render.py @@ -166,7 +166,7 @@ def create_narrow_symbols(opts: Options) -> tuple[tuple[int, int, int], ...]: descriptor_overrides: dict[int, tuple[str, bool, bool]] = {} -def descriptor_for_idx(idx: int) -> tuple[Union[FontObject | str], bool, bool]: +def descriptor_for_idx(idx: int) -> tuple[Union[FontObject, str], bool, bool]: ans = descriptor_overrides.get(idx) if ans is None: return current_faces[idx] diff --git a/kitty_tests/fonts.py b/kitty_tests/fonts.py index 285838c7f..602c30758 100644 --- a/kitty_tests/fonts.py +++ b/kitty_tests/fonts.py @@ -235,7 +235,12 @@ def block_helpers(s, sprites, cell_width, cell_height): return ans def block_test(*expected, **kw): - for i, (expected, actual) in enumerate(zip(expected, multiline_render(kw.pop('text', '█'), **kw), strict=True)): + mr = multiline_render(kw.pop('text', '█'), **kw) + try: + z = zip(expected, mr, strict=True) + except TypeError: + z = zip(expected, mr) + for i, (expected, actual) in enumerate(z): assert_blocks(expected(), actual, f'Block {i} is not equal')