Pillow: mark MAX_IMAGE_PIXELS as non-final (#10445)

This commit is contained in:
David Robertson
2023-07-12 15:11:48 +01:00
committed by GitHub
parent cfc5425cb3
commit 338e067ec4

View File

@@ -3,7 +3,7 @@ from collections.abc import Callable, Iterable, Iterator, MutableMapping, Sequen
from enum import IntEnum
from pathlib import Path
from typing import Any, ClassVar, Protocol, SupportsBytes
from typing_extensions import Final, Literal, Self, TypeAlias, TypeGuard
from typing_extensions import Literal, Self, TypeAlias, TypeGuard
from PIL.PyAccess import PyAccess
@@ -39,7 +39,12 @@ class _Writeable(SupportsWrite[bytes], Protocol):
class DecompressionBombWarning(RuntimeWarning): ...
class DecompressionBombError(Exception): ...
MAX_IMAGE_PIXELS: Final[int]
# Despite the ALL_CAPS spelling, Pillow's docs mention that this threshold can
# be altered at runtime. See
# https://pillow.readthedocs.io/en/stable/reference/Image.html#PIL.Image.open
# or the permalink
# https://github.com/python-pillow/Pillow/blob/10.0.0/docs/reference/Image.rst?plain=1#L54-L55
MAX_IMAGE_PIXELS: int | None
USE_CFFI_ACCESS: bool