mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-02-11 09:00:59 +03:00
Fixed unclosed file warnings (#8705)
Co-authored-by: Andrew Murray <radarhere@users.noreply.github.com>
This commit is contained in:
parent
e19a1496c2
commit
a9d05a1e51
|
@ -1103,13 +1103,15 @@ class TestFileLibTiff(LibTiffTestCase):
|
||||||
)
|
)
|
||||||
def test_buffering(self, test_file: str) -> None:
|
def test_buffering(self, test_file: str) -> None:
|
||||||
# load exif first
|
# load exif first
|
||||||
with Image.open(open(test_file, "rb", buffering=1048576)) as im:
|
with open(test_file, "rb", buffering=1048576) as f:
|
||||||
exif = dict(im.getexif())
|
with Image.open(f) as im:
|
||||||
|
exif = dict(im.getexif())
|
||||||
|
|
||||||
# load image before exif
|
# load image before exif
|
||||||
with Image.open(open(test_file, "rb", buffering=1048576)) as im2:
|
with open(test_file, "rb", buffering=1048576) as f:
|
||||||
im2.load()
|
with Image.open(f) as im2:
|
||||||
exif_after_load = dict(im2.getexif())
|
im2.load()
|
||||||
|
exif_after_load = dict(im2.getexif())
|
||||||
|
|
||||||
assert exif == exif_after_load
|
assert exif == exif_after_load
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user