Skip to content

Commit 5032e23

Browse files
committed
Minor type fixes
Signed-off-by: Benjamin Gilbert <[email protected]>
1 parent f4b8131 commit 5032e23

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

openslide/__init__.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ class AbstractSlide:
6969
"""The base class of a slide object."""
7070

7171
def __init__(self) -> None:
72-
self._profile = None
72+
self._profile: bytes | None = None
7373

7474
def __enter__(self) -> AbstractSlide:
7575
return self
@@ -387,7 +387,9 @@ def detect_format(cls, filename: str | bytes | Path) -> str | None:
387387
If the file format is not recognized, return None."""
388388
try:
389389
with Image.open(filename) as img:
390-
return img.format
390+
# img currently resolves as Any
391+
# https://github.com/python-pillow/Pillow/pull/8362
392+
return img.format # type: ignore[no-any-return]
391393
except OSError:
392394
return None
393395

0 commit comments

Comments
 (0)