From: Daan De Meyer Date: Wed, 29 Jan 2025 13:43:06 +0000 (+0100) Subject: ukify: Fix two typing issues X-Git-Tag: v257.3~61 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d07300405f955af8e94d4aee7d921ef05ee07fa2;p=thirdparty%2Fsystemd.git ukify: Fix two typing issues (cherry picked from commit 2d6ae4319ccecdde7a87d12cb439a892afdec943) --- diff --git a/src/ukify/ukify.py b/src/ukify/ukify.py index 4919076098a..141dd24ccb3 100755 --- a/src/ukify/ukify.py +++ b/src/ukify/ukify.py @@ -1442,7 +1442,7 @@ def inspect_section( data = section.get_data(length=size) digest = sha256(data).hexdigest() - struct = { + struct: dict[str, Union[int, str]] = { 'size': size, 'sha256': digest, } @@ -1461,7 +1461,7 @@ def inspect_section( if opts.json == 'off': print(f'{name}:\n size: {size} bytes\n sha256: {digest}') if ttype == 'text': - text = textwrap.indent(struct['text'].rstrip(), ' ' * 4) + text = textwrap.indent(cast(str, struct['text']).rstrip(), ' ' * 4) print(f' text:\n{text}') return name, struct