Skip to content

Commit

Permalink
Merge pull request #8252 from python-pillow/renovate/mypy-1.x
Browse files Browse the repository at this point in the history
Update dependency mypy to v1.11.0
  • Loading branch information
radarhere authored Jul 20, 2024
2 parents f8a9a18 + 38458a2 commit 906b8af
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .ci/requirements-mypy.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
mypy==1.10.1
mypy==1.11.0
2 changes: 2 additions & 0 deletions Tests/test_file_mpo.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,9 @@ def test_exif(test_file: str) -> None:
im_reloaded = roundtrip(im_original, save_all=True, exif=im_original.getexif())

for im in (im_original, im_reloaded):
assert isinstance(im, MpoImagePlugin.MpoImageFile)
info = im._getexif()
assert info is not None
assert info[272] == "Nintendo 3DS"
assert info[296] == 2
assert info[34665] == 188
Expand Down
2 changes: 1 addition & 1 deletion Tests/test_file_png.py
Original file line number Diff line number Diff line change
Expand Up @@ -776,7 +776,7 @@ class MyStdOut:

mystdout: MyStdOut | BytesIO = MyStdOut() if buffer else BytesIO()

sys.stdout = mystdout # type: ignore[assignment]
sys.stdout = mystdout

with Image.open(TEST_PNG_FILE) as im:
im.save(sys.stdout, "PNG")
Expand Down
2 changes: 1 addition & 1 deletion Tests/test_file_ppm.py
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ class MyStdOut:

mystdout: MyStdOut | BytesIO = MyStdOut() if buffer else BytesIO()

sys.stdout = mystdout # type: ignore[assignment]
sys.stdout = mystdout

with Image.open(TEST_FILE) as im:
im.save(sys.stdout, "PPM")
Expand Down
2 changes: 1 addition & 1 deletion Tests/test_psdraw.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class MyStdOut:

mystdout: MyStdOut | BytesIO = MyStdOut() if buffer else BytesIO()

sys.stdout = mystdout # type: ignore[assignment]
sys.stdout = mystdout

ps = PSDraw.PSDraw()
_create_document(ps)
Expand Down
4 changes: 2 additions & 2 deletions src/PIL/JpegImagePlugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@ def load_djpeg(self) -> None:

self.tile = []

def _getexif(self) -> dict[str, Any] | None:
def _getexif(self) -> dict[int, Any] | None:
return _getexif(self)

def _read_dpi_from_exif(self) -> None:
Expand Down Expand Up @@ -504,7 +504,7 @@ def _getmp(self) -> dict[int, Any] | None:
return _getmp(self)


def _getexif(self: JpegImageFile) -> dict[str, Any] | None:
def _getexif(self: JpegImageFile) -> dict[int, Any] | None:
if "exif" not in self.info:
return None
return self.getexif()._get_merged_dict()
Expand Down
2 changes: 1 addition & 1 deletion src/PIL/PngImagePlugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -1054,7 +1054,7 @@ def load_end(self) -> None:
self._prev_im.paste(updated, self.dispose_extent, mask)
self.im = self._prev_im

def _getexif(self) -> dict[str, Any] | None:
def _getexif(self) -> dict[int, Any] | None:
if "exif" not in self.info:
self.load()
if "exif" not in self.info and "Raw profile type exif" not in self.info:
Expand Down
2 changes: 1 addition & 1 deletion src/PIL/WebPImagePlugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def _open(self) -> None:
# Initialize seek state
self._reset(reset=False)

def _getexif(self) -> dict[str, Any] | None:
def _getexif(self) -> dict[int, Any] | None:
if "exif" not in self.info:
return None
return self.getexif()._get_merged_dict()
Expand Down

0 comments on commit 906b8af

Please sign in to comment.