Skip to content

Commit 9b1659a

Browse files
jorenhamradarhereakx
committed
Fix mypy errors
Co-authored-by: Andrew Murray <3112309+radarhere@users.noreply.github.com> Co-authored-by: Aarni Koskela <akx@iki.fi>
1 parent d720aae commit 9b1659a

3 files changed

Lines changed: 5 additions & 3 deletions

File tree

Tests/benchmarks.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
if TYPE_CHECKING:
1818
from collections.abc import Callable
1919

20-
from pytest_benchmark.fixture import ( # type: ignore[import-not-found]
20+
from pytest_benchmark.fixture import ( # type: ignore[unused-ignore, import-not-found]
2121
BenchmarkFixture,
2222
)
2323

src/PIL/EpsImagePlugin.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,9 @@ def _open(self) -> None:
203203
imagedata_size: tuple[int, int] | None = None
204204

205205
byte_arr = bytearray(255)
206-
bytes_mv = memoryview(byte_arr)
206+
# the extra `bytes` annotation here works around several false positive
207+
# `comparison-overlap` mypy errors
208+
bytes_mv: bytes | memoryview = memoryview(byte_arr)
207209
bytes_read = 0
208210
reading_header_comments = True
209211
reading_trailer_comments = False

src/PIL/ImageGrab.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ def grab(
7979
scale = 1 if scale_down else 2
8080
im_cropped = im.resize(
8181
((right - left) * scale, (bottom - top) * scale),
82-
box=tuple(coord * 2 for coord in bbox),
82+
box=(left * 2, top * 2, right * 2, bottom * 2),
8383
)
8484
else:
8585
im_cropped = im.crop(bbox)

0 commit comments

Comments
 (0)