Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion openslide/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Loading