From f55ccd95630153026a41f85bea71dcbae25bb4ef Mon Sep 17 00:00:00 2001 From: Yutao Yuan Date: Mon, 9 Aug 2021 23:02:33 +0800 Subject: [PATCH] Remove stdout check in ImageFile._save --- src/PIL/ImageFile.py | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/PIL/ImageFile.py b/src/PIL/ImageFile.py index 43d2bf0cc..2a7febb2b 100644 --- a/src/PIL/ImageFile.py +++ b/src/PIL/ImageFile.py @@ -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 # a tricky case. 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: fh = fp.fileno() fp.flush()