Skip to content

ImageMath.eval deprecation warning running selftest.py #7958

Closed
@hugovk

Description

@hugovk

During the release, make release-test runs python3 selftest.py:

python3 selftest.py
...
Running selftest:
<doctest __main__.testimage[57]>:1: DeprecationWarning: ImageMath.eval is deprecated and will be removed in Pillow 12 (2025-10-15). Use ImageMath.lambda_eval or ImageMath.unsafe_eval instead.
  im = ImageMath.eval("float(im + 20)", im=im.convert("L"))
--- 59 tests passed.

Here's the eval:

>>> im = ImageMath.eval("float(im + 20)", im=im.convert("L"))

Shall we rewrite it as lambda_eval, catch the deprecation warning, or just remove it?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions