From e928d33c9d73b65cb4cf1633b9ed5f16f183ecb4 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 26 Mar 2024 20:50:06 +0300 Subject: [PATCH] [pre-commit.ci] pre-commit autoupdate (#224) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [pre-commit.ci] pre-commit autoupdate updates: - [github.com/astral-sh/ruff-pre-commit: v0.3.3 → v0.3.4](https://github.com/astral-sh/ruff-pre-commit/compare/v0.3.3...v0.3.4) * fixed ruff's SIM103 warning Signed-off-by: Alexander Piskun --------- Signed-off-by: Alexander Piskun Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Alexander Piskun <13381981+bigcat88@users.noreply.github.com> --- .pre-commit-config.yaml | 2 +- libheif/linux_build_libs.py | 4 +--- pillow_heif/as_plugin.py | 15 +-------------- 3 files changed, 3 insertions(+), 18 deletions(-) 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):