diff --git a/Tests/test_imagedraw.py b/Tests/test_imagedraw.py index 881f9c85d..e1dcbc52c 100644 --- a/Tests/test_imagedraw.py +++ b/Tests/test_imagedraw.py @@ -1732,8 +1732,3 @@ def test_incorrectly_ordered_coordinates(xy: tuple[int, int, int, int]) -> None: draw.rectangle(xy) with pytest.raises(ValueError): draw.rounded_rectangle(xy) - - -def test_getdraw() -> None: - with pytest.warns(DeprecationWarning, match="'hints' parameter"): - ImageDraw.getdraw(None, []) diff --git a/docs/deprecations.rst b/docs/deprecations.rst index 3225b6d52..82530f93c 100644 --- a/docs/deprecations.rst +++ b/docs/deprecations.rst @@ -168,6 +168,14 @@ Removed features Deprecated features are only removed in major releases after an appropriate period of deprecation has passed. +ImageDraw.getdraw hints parameter +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +.. deprecated:: 10.4.0 +.. versionremoved:: 12.0.0 + +The ``hints`` parameter in :py:meth:`~PIL.ImageDraw.getdraw()` has been removed. + ImageFile.raise_oserror ~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/src/PIL/ImageDraw.py b/src/PIL/ImageDraw.py index 6cf1ee626..e95fa91f8 100644 --- a/src/PIL/ImageDraw.py +++ b/src/PIL/ImageDraw.py @@ -38,7 +38,6 @@ from types import ModuleType from typing import Any, AnyStr, Callable, Union, cast from . import Image, ImageColor -from ._deprecate import deprecate from ._typing import Coords # experimental access to the outline API @@ -1009,16 +1008,11 @@ def Draw(im: Image.Image, mode: str | None = None) -> ImageDraw: return ImageDraw(im, mode) -def getdraw( - im: Image.Image | None = None, hints: list[str] | None = None -) -> tuple[ImageDraw2.Draw | None, ModuleType]: +def getdraw(im: Image.Image | None = None) -> tuple[ImageDraw2.Draw | None, ModuleType]: """ :param im: The image to draw in. - :param hints: An optional list of hints. Deprecated. :returns: A (drawing context, drawing resource factory) tuple. """ - if hints is not None: - deprecate("'hints' parameter", 12) from . import ImageDraw2 draw = ImageDraw2.Draw(im) if im is not None else None