Handling for deprecations to be removed in Pillow 11

This commit is contained in:
Hugo van Kemenade 2023-01-20 14:35:11 +02:00
parent 50f5eade47
commit 9b660db62d
2 changed files with 7 additions and 0 deletions

View File

@ -11,6 +11,11 @@ from PIL import _deprecate
"Old thing is deprecated and will be removed in Pillow 10 "
r"\(2023-07-01\)\. Use new thing instead\.",
),
(
11,
"Old thing is deprecated and will be removed in Pillow 11 "
r"\(2024-10-15\)\. Use new thing instead\.",
),
(
None,
r"Old thing is deprecated and will be removed in a future version\. "

View File

@ -47,6 +47,8 @@ def deprecate(
raise RuntimeError(msg)
elif when == 10:
removed = "Pillow 10 (2023-07-01)"
elif when == 11:
removed = "Pillow 11 (2024-10-15)"
else:
msg = f"Unknown removal version, update {__name__}?"
raise ValueError(msg)