From cebdfb38cb9d33905c98c40d6cb5b12a2eb180f9 Mon Sep 17 00:00:00 2001 From: Douglas Raillard Date: Fri, 13 Oct 2023 13:16:48 +0100 Subject: [PATCH] lisa._kmod: Do not include __pycache__ in kmodule sources FIX __pycache__ is sometimes created around Python sources which later can affect the checksum of the module. Ensure that the __pycache__ folders and all their contents are ignored when gathering module sources. --- lisa/_kmod.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lisa/_kmod.py b/lisa/_kmod.py index 0076267d8..00022d0ac 100644 --- a/lisa/_kmod.py +++ b/lisa/_kmod.py @@ -2227,8 +2227,12 @@ class KmodSrc(Loggable): :type extra: dict(str, str) """ def get_files(root, dirs, files): - for f in files: - yield (Path(root) / f) + root = Path(root) + if root.name == '__pycache__': + return + else: + for f in files: + yield (root / f) path = Path(path).resolve() src = { -- GitLab