Skip to content

Commit

Permalink
BaseTools: Skip directories with code extensions in the name
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
xpahos committed Dec 24, 2024
1 parent 1cc7881 commit cf58c55
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion BaseTools/Plugin/DebugMacroCheck/DebugMacroCheck.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit cf58c55

Please sign in to comment.