From 9ec023503d5a521125d419def7c296826fc9e69a Mon Sep 17 00:00:00 2001 From: "neiljp (Neil Pilgrim)" Date: Tue, 22 Aug 2017 14:39:00 -0700 Subject: [PATCH] Image.__eq__: Add isinstance check. --- PIL/Image.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/PIL/Image.py b/PIL/Image.py index a45b9bf70..7e51cc832 100644 --- a/PIL/Image.py +++ b/PIL/Image.py @@ -605,7 +605,8 @@ class Image(object): return filename def __eq__(self, other): - return (self.__class__.__name__ == other.__class__.__name__ and + return (isinstance(other, Image) and + self.__class__.__name__ == other.__class__.__name__ and self.mode == other.mode and self.size == other.size and self.info == other.info and