diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 99f4327d..8febbeb4 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -29,7 +29,7 @@ repos: - id: pyproject-fmt - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.3.3 + rev: v0.3.4 hooks: - id: ruff diff --git a/libheif/linux_build_libs.py b/libheif/linux_build_libs.py index f513a4d9..db94ed0f 100644 --- a/libheif/linux_build_libs.py +++ b/libheif/linux_build_libs.py @@ -99,9 +99,7 @@ def check_install_nasm(version: str): def is_musllinux() -> bool: _ = run("ldd --version".split(), stdout=PIPE, stderr=STDOUT, check=False) - if _.stdout and _.stdout.decode("utf-8").find("musl") != -1: - return True - return False + return bool(_.stdout and _.stdout.decode("utf-8").find("musl") != -1) def is_library_installed(name: str) -> bool: diff --git a/pillow_heif/as_plugin.py b/pillow_heif/as_plugin.py index d7a2c072..f6e90367 100644 --- a/pillow_heif/as_plugin.py +++ b/pillow_heif/as_plugin.py @@ -139,20 +139,7 @@ def _is_supported_heif(fp) -> bool: magic = _get_bytes(fp, 12) if magic[4:8] != b"ftyp": return False - if magic[8:12] in ( - b"heic", - b"heix", - b"heim", - b"heis", - b"hevc", - b"hevx", - b"hevm", - b"hevs", - b"mif1", - b"msf1", - ): - return True - return False + return magic[8:12] in (b"heic", b"heix", b"heim", b"heis", b"hevc", b"hevx", b"hevm", b"hevs", b"mif1", b"msf1") def _save_heif(im, fp, _filename):