From c59eb69605cfd27f92ef593ad0bdbc67762e98af Mon Sep 17 00:00:00 2001 From: Tim 'mithro' Ansell Date: Sun, 12 Nov 2023 11:35:01 -0800 Subject: [PATCH] Add `mmap.mmap` as argument type. Fixes; ``` ERROR: /XXXX/pdk/liberty/BUILD:19:21: Checking Python types for pdk/liberty/combine_liberty.py failed: (Exit 1) pytype.par failed: error executing PytypeCheck command (from target pdk/liberty:combine_liberty@pytype@check) tools/python/pytype/pytype.par --strict-none-binding --use-enum-overlay --check --touch ... (remaining 13 arguments skipped). [forge_remote_host=jabdj1] File "pdk/liberty/combine_liberty.py", line 61, in main: Function pdk.liberty.liberty_utility.generate_merged_liberty_io_vector was called with the wrong arguments [wrong-arg-types] Expected: (liberty_files: List[bytes]) Actually passed: (liberty_files: List[mmap.mmap]) ``` Signed-off-by: Tim 'mithro' Ansell --- pdk/liberty/liberty_utility.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pdk/liberty/liberty_utility.py b/pdk/liberty/liberty_utility.py index ca066628..7ff6667c 100644 --- a/pdk/liberty/liberty_utility.py +++ b/pdk/liberty/liberty_utility.py @@ -15,13 +15,14 @@ """Utility functions to prepare the comibined liberty file.""" import itertools -from typing import List +import mmap +from typing import List, Union from pdk.liberty import cell_parser def generate_merged_liberty_io_vector( - liberty_files: List[bytes]) -> List[bytes]: + liberty_files: List[Union[bytes, mmap.mmap]]) -> List[bytes]: """Generates a merged io vector representing a combined liberty file. Args: