Skip to content

Commit

Permalink
Remove Image.coerce_e, deprecated in 9.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
hugovk committed Apr 2, 2023
1 parent 086712e commit 4c9f8b4
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 21 deletions.
7 changes: 0 additions & 7 deletions Tests/test_image_point.py
@@ -1,7 +1,5 @@
import pytest

from PIL import Image

from .helper import assert_image_equal, hopper


Expand Down Expand Up @@ -62,8 +60,3 @@ def test_f_mode():
im = hopper("F")
with pytest.raises(ValueError):
im.point(None)


def test_coerce_e_deprecation():
with pytest.warns(DeprecationWarning):
assert Image.coerce_e(2).data == 2
17 changes: 9 additions & 8 deletions docs/deprecations.rst
Expand Up @@ -12,14 +12,6 @@ Deprecated features
Below are features which are considered deprecated. Where appropriate,
a ``DeprecationWarning`` is issued.

Image.coerce_e
~~~~~~~~~~~~~~

.. deprecated:: 9.2.0

This undocumented method has been deprecated and will be removed in Pillow 10
(2023-07-01).

.. _Font size and offset methods:

Font size and offset methods
Expand Down Expand Up @@ -222,6 +214,15 @@ Support for PyQt5 and PySide2 has been removed from ``ImageQt``. Upgrade to
`PyQt6 <https://www.riverbankcomputing.com/static/Docs/PyQt6/>`_ or
`PySide6 <https://doc.qt.io/qtforpython/>`_ instead.

Image.coerce_e
~~~~~~~~~~~~~~

.. deprecated:: 9.2.0
.. versionremoved:: 10.0.0

This undocumented method has been deprecated and will be removed in Pillow 10
(2023-07-01).

PILLOW_VERSION constant
~~~~~~~~~~~~~~~~~~~~~~~

Expand Down
6 changes: 0 additions & 6 deletions src/PIL/Image.py
Expand Up @@ -56,7 +56,6 @@
_plugins,
)
from ._binary import i32le, o32be, o32le
from ._deprecate import deprecate
from ._util import DeferredError, is_path

logger = logging.getLogger(__name__)
Expand Down Expand Up @@ -421,11 +420,6 @@ def _getencoder(mode, encoder_name, args, extra=()):
# Simple expression analyzer


def coerce_e(value):
deprecate("coerce_e", 10)
return value if isinstance(value, _E) else _E(1, value)


# _E(scale, offset) represents the affine transformation scale * x + offset.
# The "data" field is named for compatibility with the old implementation,
# and should be renamed once coerce_e is removed.
Expand Down

0 comments on commit 4c9f8b4

Please sign in to comment.