Skip to content

Commit 0e3aac1

Browse files
committed
Updated deprecation timeline
1 parent 92bafe6 commit 0e3aac1

File tree

2 files changed

+10
-12
lines changed

2 files changed

+10
-12
lines changed

Tests/test_deprecate.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
"version, expected",
1010
[
1111
(
12-
12,
13-
"Old thing is deprecated and will be removed in Pillow 12 "
14-
r"\(2025-10-15\)\. Use new thing instead\.",
12+
13,
13+
"Old thing is deprecated and will be removed in Pillow 13 "
14+
r"\(2026-10-15\)\. Use new thing instead\.",
1515
),
1616
(
1717
None,
@@ -53,18 +53,18 @@ def test_old_version(deprecated: str, plural: bool, expected: str) -> None:
5353

5454
def test_plural() -> None:
5555
expected = (
56-
r"Old things are deprecated and will be removed in Pillow 12 \(2025-10-15\)\. "
56+
r"Old things are deprecated and will be removed in Pillow 13 \(2026-10-15\)\. "
5757
r"Use new thing instead\."
5858
)
5959
with pytest.warns(DeprecationWarning, match=expected):
60-
_deprecate.deprecate("Old things", 12, "new thing", plural=True)
60+
_deprecate.deprecate("Old things", 13, "new thing", plural=True)
6161

6262

6363
def test_replacement_and_action() -> None:
6464
expected = "Use only one of 'replacement' and 'action'"
6565
with pytest.raises(ValueError, match=expected):
6666
_deprecate.deprecate(
67-
"Old thing", 12, replacement="new thing", action="Upgrade to new thing"
67+
"Old thing", 13, replacement="new thing", action="Upgrade to new thing"
6868
)
6969

7070

@@ -77,16 +77,16 @@ def test_replacement_and_action() -> None:
7777
)
7878
def test_action(action: str) -> None:
7979
expected = (
80-
r"Old thing is deprecated and will be removed in Pillow 12 \(2025-10-15\)\. "
80+
r"Old thing is deprecated and will be removed in Pillow 13 \(2026-10-15\)\. "
8181
r"Upgrade to new thing\."
8282
)
8383
with pytest.warns(DeprecationWarning, match=expected):
84-
_deprecate.deprecate("Old thing", 12, action=action)
84+
_deprecate.deprecate("Old thing", 13, action=action)
8585

8686

8787
def test_no_replacement_or_action() -> None:
8888
expected = (
89-
r"Old thing is deprecated and will be removed in Pillow 12 \(2025-10-15\)"
89+
r"Old thing is deprecated and will be removed in Pillow 13 \(2026-10-15\)"
9090
)
9191
with pytest.warns(DeprecationWarning, match=expected):
92-
_deprecate.deprecate("Old thing", 12)
92+
_deprecate.deprecate("Old thing", 13)

src/PIL/_deprecate.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,6 @@ def deprecate(
4646
elif when <= int(__version__.split(".")[0]):
4747
msg = f"{deprecated} {is_} deprecated and should be removed."
4848
raise RuntimeError(msg)
49-
elif when == 12:
50-
removed = "Pillow 12 (2025-10-15)"
5149
elif when == 13:
5250
removed = "Pillow 13 (2026-10-15)"
5351
else:

0 commit comments

Comments
 (0)