Skip to content
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

Added class checking to __eq__ function #775

Merged
merged 3 commits into from
Jul 7, 2014

Conversation

radarhere
Copy link
Member

The eq function in Image.py makes no allowances that the comparison object might not be another Image instance.

So

>>> item = Image.new('RGB',(25,25),'#000')
>>> item == None

gives

Image.py, line 578, in __eq__
    a = (self.mode == other.mode)
AttributeError: 'NoneType' object has no attribute 'mode'

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.01%) when pulling 1aee9bf on radarhere:master into 8e6ef35 on python-pillow:master.

@hugovk
Copy link
Member

hugovk commented Jul 5, 2014

Test case: radarhere#1

@coveralls
Copy link

Coverage Status

Coverage increased (+0.01%) when pulling 516d896 on radarhere:master into 8e6ef35 on python-pillow:master.

hugovk added a commit that referenced this pull request Jul 7, 2014
Added class checking to Image __eq__ function
@hugovk hugovk merged commit 737c744 into python-pillow:master Jul 7, 2014
@hugovk
Copy link
Member

hugovk commented Jul 7, 2014

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants