We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents cd32d2e + 400d3bd commit dc9de54Copy full SHA for dc9de54
1 file changed
src/fromager/sources.py
@@ -867,10 +867,11 @@ def scan_compiled_extensions(
867
elif suffix not in ignore_suffixes:
868
# Path.walk() lists symlinks to directories as filenames
869
# rather than dirnames, causing IsADirectoryError on open().
870
- if not filepath.is_file():
+ try:
871
+ with filepath.open("rb") as f:
872
+ header = f.read(_MAGIC_HEADERS_READ)
873
+ except IsADirectoryError:
874
continue
- with filepath.open("rb") as f:
- header = f.read(_MAGIC_HEADERS_READ)
875
if header.startswith(magic_headers):
876
relpath = filepath.relative_to(root_dir)
877
logger.debug(
0 commit comments