mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-02-21 05:50:53 +03:00
Fix pypy 2.4 regression, #952
This commit is contained in:
parent
9b66864e07
commit
a15bf21ea1
|
@ -883,6 +883,10 @@ class TiffImageFile(ImageFile.ImageFile):
|
||||||
try:
|
try:
|
||||||
fp = hasattr(self.fp, "fileno") and \
|
fp = hasattr(self.fp, "fileno") and \
|
||||||
os.dup(self.fp.fileno())
|
os.dup(self.fp.fileno())
|
||||||
|
# flush the file descriptor, prevents error on pypy 2.4+
|
||||||
|
# should also eliminate the need for fp.tell for py3
|
||||||
|
# in _seek
|
||||||
|
self.fp.flush()
|
||||||
except IOError:
|
except IOError:
|
||||||
# io.BytesIO have a fileno, but returns an IOError if
|
# io.BytesIO have a fileno, but returns an IOError if
|
||||||
# it doesn't use a file descriptor.
|
# it doesn't use a file descriptor.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user