Skip to content

Commit 338e067

Browse files
authored
Pillow: mark MAX_IMAGE_PIXELS as non-final (#10445)
1 parent cfc5425 commit 338e067

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

stubs/Pillow/PIL/Image.pyi

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ from collections.abc import Callable, Iterable, Iterator, MutableMapping, Sequen
33
from enum import IntEnum
44
from pathlib import Path
55
from typing import Any, ClassVar, Protocol, SupportsBytes
6-
from typing_extensions import Final, Literal, Self, TypeAlias, TypeGuard
6+
from typing_extensions import Literal, Self, TypeAlias, TypeGuard
77

88
from PIL.PyAccess import PyAccess
99

@@ -39,7 +39,12 @@ class _Writeable(SupportsWrite[bytes], Protocol):
3939
class DecompressionBombWarning(RuntimeWarning): ...
4040
class DecompressionBombError(Exception): ...
4141

42-
MAX_IMAGE_PIXELS: Final[int]
42+
# Despite the ALL_CAPS spelling, Pillow's docs mention that this threshold can
43+
# be altered at runtime. See
44+
# https://pillow.readthedocs.io/en/stable/reference/Image.html#PIL.Image.open
45+
# or the permalink
46+
# https://github.com/python-pillow/Pillow/blob/10.0.0/docs/reference/Image.rst?plain=1#L54-L55
47+
MAX_IMAGE_PIXELS: int | None
4348

4449
USE_CFFI_ACCESS: bool
4550

0 commit comments

Comments
 (0)