File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -255,20 +255,22 @@ def hopper(mode: str | None = None) -> Image.Image:
255255 # Use caching to reduce reading from disk, but return a copy
256256 # so that the cached image isn't modified by the tests
257257 # (for fast, isolated, repeatable tests).
258- return _cached_hopper (mode ).copy ()
259-
260258
261- @lru_cache (maxsize = None )
262- def _cached_hopper (mode : str | None = None ) -> Image .Image :
263259 if mode is None :
264260 # Always return fresh not-yet-loaded version of image.
265261 # Operations on not-yet-loaded images is separate class of errors
266262 # what we should catch.
267263 return Image .open ("Tests/images/hopper.ppm" )
264+
265+ return _cached_hopper (mode ).copy ()
266+
267+
268+ @lru_cache (maxsize = None )
269+ def _cached_hopper (mode : str | None = None ) -> Image .Image :
268270 if mode == "F" :
269- im = _cached_hopper ("L" ).convert (mode )
271+ im = hopper ("L" ).convert (mode )
270272 else :
271- im = _cached_hopper ().convert (mode )
273+ im = hopper ().convert (mode )
272274 return im
273275
274276
You can’t perform that action at this time.
0 commit comments