mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-07-10 08:12:33 +03:00
Removed ImageDraw.getdraw hints parameter
This commit is contained in:
parent
88018c1c2d
commit
a7e00fba8b
|
@ -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, [])
|
||||
|
|
|
@ -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
|
||||
~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue
Block a user