diff --git a/Tests/test_image_getdata.py b/Tests/test_image_getdata.py index dd3d70b34..c8b213d84 100644 --- a/Tests/test_image_getdata.py +++ b/Tests/test_image_getdata.py @@ -15,7 +15,7 @@ def test_sanity() -> None: def test_mode() -> None: - def getdata(mode: str) -> tuple[float | tuple[int, ...], int, int]: + def getdata(mode: str) -> tuple[float | tuple[int, ...] | None, int, int]: im = hopper(mode).resize((32, 30), Image.Resampling.NEAREST) data = im.getdata() return data[0], len(data), len(list(data)) diff --git a/src/PIL/_imaging.pyi b/src/PIL/_imaging.pyi index 998bc52eb..81028a596 100644 --- a/src/PIL/_imaging.pyi +++ b/src/PIL/_imaging.pyi @@ -1,7 +1,7 @@ from typing import Any class ImagingCore: - def __getitem__(self, index: int) -> float: ... + def __getitem__(self, index: int) -> float | tuple[int, ...] | None: ... def __getattr__(self, name: str) -> Any: ... class ImagingFont: