-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comparing Image to None throws error #869
Labels
Comments
This is a duplicate of #774 which was fixed in #775 on 7th July 2014, just missing the quarterly release, so it'll be in the next one be around the end of September. 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())
d = (self.info == other.info)
e = (self.category == other.category)
f = (self.readonly == other.readonly)
g = (self.tobytes() == other.tobytes())
return a and b and c and d and e and f and g |
Great! Sorry for the duplicate, forgot to search for already closed issues. |
No problem, better reported twice than not at all! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In
Image.py
you have the following compare methods:If attempting to compare an image to
None
, this errors out with the errorAttributeError: 'NoneType' object has no attribute 'mode'
.Please at least make comparisons against
None
safe. Preferably comparisons against all values as well.The text was updated successfully, but these errors were encountered: