INNER CODE UNIT · Python
is_compatible
alper-han/CrossMacro · scripts/ci/verify-glibc-baseline.py:28
def is_compatible(versions: list[tuple[int, ...]], maximum: tuple[int, ...]) -> bool:
return not versions or max(versions) <= maximum
def is_elf_file(path: Path) -> bool:
try:
with path.open("rb") as stream:
return stream.read(len(ELF_MAGIC)) == ELF_MAGIC
except OSError:
return False
def discover_elf_files(paths: list[Path]) -> list[Path]:
candidates: list[Path] = []
for path in paths:
if path.is_dir():
candidates.extend(candidate for candidate in path.rglob("*") if candidate.is_file())
elif path.is_file():