From 88be36c27aade7af422d5bf934d05a8a4b51d7d3 Mon Sep 17 00:00:00 2001 From: chadawagner Date: Tue, 30 Jul 2019 11:26:04 -0700 Subject: [PATCH] check prior fp result, do not use if False --- src/PIL/TiffImagePlugin.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/PIL/TiffImagePlugin.py b/src/PIL/TiffImagePlugin.py index dabcf8eb4..fb394af16 100644 --- a/src/PIL/TiffImagePlugin.py +++ b/src/PIL/TiffImagePlugin.py @@ -1164,7 +1164,7 @@ class TiffImageFile(ImageFile.ImageFile): if DEBUG: print("have getvalue. just sending in a string from getvalue") n, err = decoder.decode(self.fp.getvalue()) - elif hasattr(self.fp, "fileno"): + elif fp: # we've got a actual file on disk, pass in the fp. if DEBUG: print("have fileno, calling fileno version of the decoder.")