mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-26 17:24:31 +03:00
Only close existing fp if fp is exclusive
This commit is contained in:
parent
f4ce428a4f
commit
e84a78d828
|
@ -139,7 +139,6 @@ class TestFileWebp(PillowTestCase):
|
|||
self.assertRaises(TypeError, _webp.WebPAnimDecoder)
|
||||
self.assertRaises(TypeError, _webp.WebPDecode)
|
||||
|
||||
@unittest.skip("Currently is not working")
|
||||
def test_no_resource_warning(self):
|
||||
file_path = "Tests/images/hopper.webp"
|
||||
image = Image.open(file_path)
|
||||
|
|
|
@ -163,6 +163,8 @@ class WebPImageFile(ImageFile.ImageFile):
|
|||
self.__loaded = self.__logical_frame
|
||||
|
||||
# Set tile
|
||||
if self.fp and self._exclusive_fp:
|
||||
self.fp.close()
|
||||
self.fp = BytesIO(data)
|
||||
self.tile = [("raw", (0, 0) + self.size, 0, self.rawmode)]
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user