diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 0064d032..d2c0fc91 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -40,7 +40,7 @@ repos: name: Check Python types priority: 0 # Pillow is ignored in dependabot.yml - additional_dependencies: [flask, openslide-bin, pillow >= 12.1.0, types-PyYAML, types-setuptools] + additional_dependencies: [flask, openslide-bin, pillow >= 13.0.0, types-PyYAML, types-setuptools] - repo: https://github.com/rstcheck/rstcheck rev: v6.3.0 diff --git a/openslide/__init__.py b/openslide/__init__.py index f3b4844d..f8c6e367 100644 --- a/openslide/__init__.py +++ b/openslide/__init__.py @@ -392,7 +392,8 @@ def detect_format(cls, filename: lowlevel.Filename) -> str | None: If the file format is not recognized, return None.""" try: with Image.open(filename) as img: - return img.format + # mypy will think img is Any until we drop Python 3.10 + return img.format # type: ignore[no-any-return] except OSError: return None