From 83124c5ca86e93e62bccdd02ce8f250eb8102d3d Mon Sep 17 00:00:00 2001 From: Eric Soroos Date: Fri, 5 Jan 2018 10:34:41 +0000 Subject: [PATCH] Typing: resize -- ignore tuple manipulations --- src/PIL/Image.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/PIL/Image.py b/src/PIL/Image.py index 43db5656b..262a3cc37 100644 --- a/src/PIL/Image.py +++ b/src/PIL/Image.py @@ -1830,12 +1830,15 @@ class Image(object): ): raise ValueError("unknown resampling filter") - size = tuple(size) + size = tuple(size) # type: ignore + # Typing note -- historically we've allowed Iterables of + # len==2 as sizes, but technically they're supposed to be + # 2-tuples. if box is None: - box = (0, 0) + self.size + box = (0, 0) + self.size # type: ignore else: - box = tuple(box) + box = tuple(box) # type: ignore if self.size == size and box == (0, 0) + self.size: return self.copy()