mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-26 18:06:18 +03:00
flush if hasattr
Co-authored-by: Andrew Murray <3112309+radarhere@users.noreply.github.com>
This commit is contained in:
parent
70fafe3da7
commit
38d45d2848
|
@ -352,7 +352,8 @@ def _save(im, fp, filename):
|
|||
fp.write(struct.pack("<i", HEADERSIZE + e["size"])[::-1])
|
||||
fp.write(e["stream"].getvalue())
|
||||
|
||||
fp.flush()
|
||||
if hasattr(fp, "flush"):
|
||||
fp.flush()
|
||||
|
||||
|
||||
Image.register_open(IcnsImageFile.format, IcnsImageFile, lambda x: x[:4] == b"icns")
|
||||
|
|
Loading…
Reference in New Issue
Block a user