From 1aee9bfdef1d73007d8e35ab883c8c936c1da602 Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Sat, 5 Jul 2014 23:16:14 +1000 Subject: [PATCH] Added class checking to __eq__ function --- PIL/Image.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/PIL/Image.py b/PIL/Image.py index 787e60270..ea8cc6155 100644 --- a/PIL/Image.py +++ b/PIL/Image.py @@ -573,6 +573,8 @@ class Image: return file def __eq__(self, other): + if self.__class__.__name__ != other.__class__.__name__: + return False a = (self.mode == other.mode) b = (self.size == other.size) c = (self.getpalette() == other.getpalette())