Merge pull request #8252 from python-pillow/renovate/mypy-1.x

Update dependency mypy to v1.11.0
This commit is contained in:
Andrew Murray 2024-07-20 19:57:16 +10:00 committed by GitHub
commit 906b8afe85
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with 10 additions and 8 deletions

View File

@ -1 +1 @@
mypy==1.10.1
mypy==1.11.0

View File

@ -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

View File

@ -776,7 +776,7 @@ class TestFilePng:
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")

View File

@ -373,7 +373,7 @@ def test_save_stdout(buffer: bool) -> None:
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")

View File

@ -59,7 +59,7 @@ def test_stdout(buffer: bool) -> None:
mystdout: MyStdOut | BytesIO = MyStdOut() if buffer else BytesIO()
sys.stdout = mystdout # type: ignore[assignment]
sys.stdout = mystdout
ps = PSDraw.PSDraw()
_create_document(ps)

View File

@ -468,7 +468,7 @@ class JpegImageFile(ImageFile.ImageFile):
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:
@ -504,7 +504,7 @@ class JpegImageFile(ImageFile.ImageFile):
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()

View File

@ -1054,7 +1054,7 @@ class PngImageFile(ImageFile.ImageFile):
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:

View File

@ -96,7 +96,7 @@ class WebPImageFile(ImageFile.ImageFile):
# 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()