Adjust tuple construction in ImageGrab to fix mypy on macOS - #9935
Merged
Conversation
hugovk
approved these changes
Sep 1, 2026
hugovk
left a comment
Member
There was a problem hiding this comment.
Thanks, on macOS, on main I get:
❯ tox -e mypy
mypy: commands[0]> mypy conftest.py selftest.py setup.py checks docs src winbuild Tests
src/PIL/ImageGrab.py:82: error: Argument "box" to "resize" of "Image" has incompatible
type "tuple[int, ...]"; expected "tuple[float, float, float, float] | None" [arg-type]
box=tuple(coord * 2 for coord in bbox),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Found 1 error in 1 file (checked 302 source files)
mypy: exit 1 (2.58 seconds) /Users/hugo/github/Pillow> mypy conftest.py selftest.py setup.py checks docs src winbuild Tests pid=84969
mypy: FAIL code 1 (2.58=setup[0.00]+cmd[2.58] seconds)
evaluation failed :( (2.63 seconds)And with this PR:
❯ tox -e mypy
mypy: commands[0]> mypy conftest.py selftest.py setup.py checks docs src winbuild Tests
Success: no issues found in 302 source files
mypy: OK (2.22=setup[0.00]+cmd[2.22] seconds)
congratulations :) (2.27 seconds)
radarhere
enabled auto-merge (squash)
September 1, 2026 10:45
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Split out per #9803 (comment)