diff --git a/Tests/test_file_gif.py b/Tests/test_file_gif.py index 3d3d43a7e..0c27865cd 100644 --- a/Tests/test_file_gif.py +++ b/Tests/test_file_gif.py @@ -9,7 +9,8 @@ if "gif_encoder" not in codecs or "gif_decoder" not in codecs: # sample gif stream file = "Images/lena.gif" -data = open(file, "rb").read() +with open(file, "rb") as f: + data = f.read() def test_sanity(): im = Image.open(file)