diff --git a/Tests/test_file_avif.py b/Tests/test_file_avif.py index 3dc5c87aaee..119a98d536c 100644 --- a/Tests/test_file_avif.py +++ b/Tests/test_file_avif.py @@ -313,7 +313,7 @@ def test_exif_save( else: assert reloaded.info["exif"] == exif_data - def test_exif_without_orientation(self, tmp_path: Path): + def test_exif_without_orientation(self, tmp_path: Path) -> None: exif = Image.Exif() exif[272] = b"test" exif_data = exif.tobytes() @@ -570,7 +570,7 @@ def test_svt_optimizations(self, tmp_path: Path) -> None: @skip_unless_feature("avif") class TestAvifAnimation: @contextmanager - def star_frames(self) -> Generator[list[ImageFile.ImageFile], None, None]: + def star_frames(self) -> Generator[list[Image.Image], None, None]: with Image.open("Tests/images/avif/star.png") as f: yield [f, f.rotate(90), f.rotate(180), f.rotate(270)] @@ -636,8 +636,8 @@ def check(temp_file: str) -> None: # Test appending using a generator def imGenerator( - ims: list[ImageFile.ImageFile], - ) -> Generator[ImageFile.ImageFile, None, None]: + ims: list[Image.Image], + ) -> Generator[Image.Image, None, None]: yield from ims temp_file2 = str(tmp_path / "temp_generator.avif") diff --git a/src/PIL/AvifImagePlugin.py b/src/PIL/AvifImagePlugin.py index 8125b548a06..dbce440eef9 100644 --- a/src/PIL/AvifImagePlugin.py +++ b/src/PIL/AvifImagePlugin.py @@ -45,7 +45,7 @@ def _accept(prefix: bytes) -> bool | str: return False -def _get_default_max_threads(): +def _get_default_max_threads() -> int: if DEFAULT_MAX_THREADS: return DEFAULT_MAX_THREADS if hasattr(os, "sched_getaffinity"):