mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-08-25 22:54:46 +03:00
Fixed unclosed file warning
This commit is contained in:
parent
7bf5246b93
commit
dc605f7d30
|
@ -54,6 +54,9 @@ class TestFileMic(PillowTestCase):
|
|||
self.assertRaises(EOFError, im.seek, 99)
|
||||
self.assertEqual(im.tell(), 0)
|
||||
|
||||
def test_unclosed_file(self):
|
||||
self.assert_warning(None, Image.open, TEST_FILE)
|
||||
|
||||
def test_invalid_file(self):
|
||||
# Test an invalid OLE file
|
||||
invalid_file = "Tests/images/flower.jpg"
|
||||
|
|
|
@ -88,7 +88,9 @@ class MicImageFile(TiffImagePlugin.TiffImageFile):
|
|||
except IndexError:
|
||||
raise EOFError("no such frame")
|
||||
|
||||
prev_fp = self.fp
|
||||
self.fp = self.ole.openstream(filename)
|
||||
prev_fp.close()
|
||||
|
||||
TiffImagePlugin.TiffImageFile._open(self)
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user