Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ImageMath.eval deprecation warning running selftest.py #7958

Closed
hugovk opened this issue Apr 8, 2024 · 1 comment · Fixed by #7960
Closed

ImageMath.eval deprecation warning running selftest.py #7958

hugovk opened this issue Apr 8, 2024 · 1 comment · Fixed by #7960
Labels

Comments

@hugovk
Copy link
Member

hugovk commented Apr 8, 2024

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?

@radarhere
Copy link
Member

Rewriting it with lambda_eval would be my suggestion. #7960

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants