From 1a2d9c6fba5d828f9af7c7ffd666855ee2794d7d Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 28 Apr 2022 07:03:35 +0530 Subject: [PATCH] Fix a couple of issues highlighted by updated mypy --- kittens/diff/highlight.py | 2 +- kittens/diff/render.py | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/kittens/diff/highlight.py b/kittens/diff/highlight.py index 7272f8984..dd7824285 100644 --- a/kittens/diff/highlight.py +++ b/kittens/diff/highlight.py @@ -161,7 +161,7 @@ def highlight_collection(collection: Collection, aliases: Optional[Dict[str, str if p: is_binary = isinstance(data_for_path(p), bytes) if not is_binary: - jobs[executor.submit(highlight_for_diff, p, aliases)] = p + jobs[executor.submit(highlight_for_diff, p, aliases or {})] = p for future in concurrent.futures.as_completed(jobs): path = jobs[future] try: diff --git a/kittens/diff/render.py b/kittens/diff/render.py index 6e6cbdf13..4408e128b 100644 --- a/kittens/diff/render.py +++ b/kittens/diff/render.py @@ -36,6 +36,8 @@ def images_supported() -> bool: class Ref: + __slots__: Tuple[str, ...] = () + def __setattr__(self, name: str, value: object) -> None: raise AttributeError("can't set attribute")