Skip to content

Commit a7e00fb

Browse files
committed
Removed ImageDraw.getdraw hints parameter
1 parent 88018c1 commit a7e00fb

File tree

3 files changed

+9
-12
lines changed

3 files changed

+9
-12
lines changed

Tests/test_imagedraw.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1732,8 +1732,3 @@ def test_incorrectly_ordered_coordinates(xy: tuple[int, int, int, int]) -> None:
17321732
draw.rectangle(xy)
17331733
with pytest.raises(ValueError):
17341734
draw.rounded_rectangle(xy)
1735-
1736-
1737-
def test_getdraw() -> None:
1738-
with pytest.warns(DeprecationWarning, match="'hints' parameter"):
1739-
ImageDraw.getdraw(None, [])

docs/deprecations.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,14 @@ Removed features
168168
Deprecated features are only removed in major releases after an appropriate
169169
period of deprecation has passed.
170170

171+
ImageDraw.getdraw hints parameter
172+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
173+
174+
.. deprecated:: 10.4.0
175+
.. versionremoved:: 12.0.0
176+
177+
The ``hints`` parameter in :py:meth:`~PIL.ImageDraw.getdraw()` has been removed.
178+
171179
ImageFile.raise_oserror
172180
~~~~~~~~~~~~~~~~~~~~~~~
173181

src/PIL/ImageDraw.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@
3838
from typing import Any, AnyStr, Callable, Union, cast
3939

4040
from . import Image, ImageColor
41-
from ._deprecate import deprecate
4241
from ._typing import Coords
4342

4443
# experimental access to the outline API
@@ -1009,16 +1008,11 @@ def Draw(im: Image.Image, mode: str | None = None) -> ImageDraw:
10091008
return ImageDraw(im, mode)
10101009

10111010

1012-
def getdraw(
1013-
im: Image.Image | None = None, hints: list[str] | None = None
1014-
) -> tuple[ImageDraw2.Draw | None, ModuleType]:
1011+
def getdraw(im: Image.Image | None = None) -> tuple[ImageDraw2.Draw | None, ModuleType]:
10151012
"""
10161013
:param im: The image to draw in.
1017-
:param hints: An optional list of hints. Deprecated.
10181014
:returns: A (drawing context, drawing resource factory) tuple.
10191015
"""
1020-
if hints is not None:
1021-
deprecate("'hints' parameter", 12)
10221016
from . import ImageDraw2
10231017

10241018
draw = ImageDraw2.Draw(im) if im is not None else None

0 commit comments

Comments
 (0)