Remove stdout check in ImageFile._save

This commit is contained in:
Yutao Yuan 2021-08-09 23:02:33 +08:00
parent 953b57510f
commit f55ccd9563

View File

@ -493,13 +493,6 @@ def _save(im, fp, tile, bufsize=0):
# But, it would need at least the image size in most cases. RawEncode is # But, it would need at least the image size in most cases. RawEncode is
# a tricky case. # a tricky case.
bufsize = max(MAXBLOCK, bufsize, im.size[0] * 4) # see RawEncode.c bufsize = max(MAXBLOCK, bufsize, im.size[0] * 4) # see RawEncode.c
try:
stdout = fp == sys.stdout or fp == sys.stdout.buffer
except (OSError, AttributeError):
stdout = False
if stdout:
fp.flush()
return
try: try:
fh = fp.fileno() fh = fp.fileno()
fp.flush() fp.flush()