mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-25 17:36:18 +03:00
Fixed closing file pointer with olefile 0.47
This commit is contained in:
parent
76446ee450
commit
0e523d9868
|
@ -227,6 +227,7 @@ class FpxImageFile(ImageFile.ImageFile):
|
|||
break # isn't really required
|
||||
|
||||
self.stream = stream
|
||||
self._fp = self.fp
|
||||
self.fp = None
|
||||
|
||||
def load(self):
|
||||
|
|
|
@ -66,6 +66,7 @@ class MicImageFile(TiffImagePlugin.TiffImageFile):
|
|||
self._n_frames = len(self.images)
|
||||
self.is_animated = self._n_frames > 1
|
||||
|
||||
self.__fp = self.fp
|
||||
self.seek(0)
|
||||
|
||||
def seek(self, frame):
|
||||
|
@ -87,10 +88,12 @@ class MicImageFile(TiffImagePlugin.TiffImageFile):
|
|||
return self.frame
|
||||
|
||||
def close(self):
|
||||
self.__fp.close()
|
||||
self.ole.close()
|
||||
super().close()
|
||||
|
||||
def __exit__(self, *args):
|
||||
self.__fp.close()
|
||||
self.ole.close()
|
||||
super().__exit__()
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user