Skip to content

Commit

Permalink
Updated type hints
Browse files Browse the repository at this point in the history
  • Loading branch information
radarhere committed Jan 26, 2025
1 parent c033336 commit b84bc11
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions Tests/test_file_avif.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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)]

Expand Down Expand Up @@ -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")
Expand Down
2 changes: 1 addition & 1 deletion src/PIL/AvifImagePlugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"):
Expand Down

0 comments on commit b84bc11

Please sign in to comment.