Skip to content

Commit

Permalink
Use lru_cache for Python 3.8 compatibilty
Browse files Browse the repository at this point in the history
  • Loading branch information
hugovk committed Jan 15, 2024
1 parent 96eb24b commit 9f75bba
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/PIL/ImageMath.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
from __future__ import annotations

import builtins
from functools import cache
from functools import lru_cache
from types import CodeType
from typing import Any

Expand Down Expand Up @@ -225,7 +225,7 @@ def imagemath_convert(self: _Operand, mode: str) -> _Operand:
return _Operand(self.im.convert(mode))


@cache
@lru_cache
def _get_ops() -> dict[str, Any]:
return {k[10:]: v for k, v in globals().items() if k[:10] == "imagemath_"}

Expand Down

0 comments on commit 9f75bba

Please sign in to comment.