`ImageMath.eval` deprecation warning running `selftest.py`
hugovk opened this issue · comments
Hugo van Kemenade commented
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
:
Line 142 in 33a73b5
Shall we rewrite it as lambda_eval
, catch the deprecation warning, or just remove it?
Andrew Murray commented
Rewriting it with lambda_eval
would be my suggestion. #7960