From cf58c55b641f8d63af17b11add8ab87696469f9d Mon Sep 17 00:00:00 2001 From: Alexander Gryanko Date: Wed, 25 Dec 2024 02:18:16 +0300 Subject: [PATCH] BaseTools: Skip directories with code extensions in the name Currently openssl has an Open Quantum Safe provider submodule with directories like oqs-provider/oqs-template/oqsprov/oqsprov.c or oqs-provider/oqs-template/oqsprov/oqsprov/oqsprov_capabilities.c that are used as templates, but DebugMacroCheck tries to read them as a file when recursively traversing the subdirectories. Fail message: File "/usr/lib/python3.10/pathlib.py", line 1119, in open return self._accessor.open(self, mode, buffering, encoding, errors, IsADirectoryError: [Errno 21] Is a directory: '/CryptoPkg/Library /OpensslLib/openssl/oqs-provider/oqs-template/oqsprov/oqsprov.c' Signed-off-by: Alexander Gryanko --- BaseTools/Plugin/DebugMacroCheck/DebugMacroCheck.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BaseTools/Plugin/DebugMacroCheck/DebugMacroCheck.py b/BaseTools/Plugin/DebugMacroCheck/DebugMacroCheck.py index ffabcdf91b60..1aedafb22c45 100644 --- a/BaseTools/Plugin/DebugMacroCheck/DebugMacroCheck.py +++ b/BaseTools/Plugin/DebugMacroCheck/DebugMacroCheck.py @@ -429,7 +429,7 @@ def _show_file_discovered_message(file_count: int, files = [] for file in root_directory.rglob('*'): - if file.suffix in extensions: + if not file.is_dir and file.suffix in extensions: files.append(Path(file)) # Give an indicator progress is being made