Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update dependency mypy to v1.11.0 #8252

Merged
merged 3 commits into from
Jul 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading