Skip to content

Commit a2c1892

Browse files
committed
Fix type hints detected thanks to PIL update
1 parent 91337d1 commit a2c1892

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/zimscraperlib/image/probing.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import io
88
import pathlib
99
import re
10+
from typing import IO
1011

1112
import colorthief
1213
import PIL.Image
@@ -52,7 +53,7 @@ def is_hex_color(text: str) -> bool:
5253

5354

5455
def format_for(
55-
src: pathlib.Path | io.BytesIO,
56+
src: pathlib.Path | IO[bytes],
5657
from_suffix: bool = True, # noqa: FBT001, FBT002
5758
) -> str:
5859
"""Pillow format of a given filename, either Pillow-detected or from suffix"""
@@ -70,7 +71,7 @@ def format_for(
7071

7172

7273
def is_valid_image(
73-
image: pathlib.Path | io.IOBase | bytes,
74+
image: pathlib.Path | IO[bytes] | bytes,
7475
imformat: str,
7576
size: tuple[int, int] | None = None,
7677
) -> bool:

0 commit comments

Comments
 (0)