From a36d883800b0553dd39fcfa54e2b8012eb9696d3 Mon Sep 17 00:00:00 2001 From: Vladislav Yarmak Date: Wed, 23 Oct 2019 20:00:32 +0300 Subject: [PATCH] win: ap: add cache to driver identification routine --- win/tools/autopatch/autopatch.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/win/tools/autopatch/autopatch.py b/win/tools/autopatch/autopatch.py index 2a922be..533262e 100755 --- a/win/tools/autopatch/autopatch.py +++ b/win/tools/autopatch/autopatch.py @@ -8,6 +8,7 @@ import os.path from binascii import unhexlify import xml.etree.ElementTree as ET import itertools +import functools CRLF = b"\x0d\x0a" @@ -170,6 +171,7 @@ def make_patch(archive, *, return res +@functools.lru_cache(maxsize=None) def identify_driver(archive, *, sevenzip="7z"): manifest = extract_single_file(archive, "setup.cfg", sevenzip=sevenzip) root = ET.fromstring(manifest)