Skip to content

Commit a9fd14b

Browse files
authored
Add context manager (#9864)
1 parent d0ea334 commit a9fd14b

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

Tests/benchmarks.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -868,7 +868,8 @@ def test_quantize_to_palette(
868868
size: tuple[int, int],
869869
) -> None:
870870
if isinstance(source_type, pathlib.Path):
871-
im = Image.open(source_type).convert("RGB").resize(size)
871+
with Image.open(source_type) as source_im:
872+
im = source_im.convert("RGB").resize(size)
872873
elif source_type == "synthetic":
873874
im = make_pillow_image("RGB", size)
874875
if palette_type == "exact":

0 commit comments

Comments
 (0)