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

Comparison between Image instance and other types fails #774

Closed
radarhere opened this issue Jul 5, 2014 · 5 comments
Closed

Comparison between Image instance and other types fails #774

radarhere opened this issue Jul 5, 2014 · 5 comments

Comments

@radarhere
Copy link
Member

radarhere commented Jul 5, 2014

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'
@aclark4life
Copy link
Member

Got a pull request? Thanks

@radarhere
Copy link
Member Author

Hmm. Apologies for the apparent mess. I'm clearly not as familiar with pull requests as I ought to be.

@hugovk
Copy link
Member

hugovk commented Jul 5, 2014

@radarhere The PR looks fine. Here's a test: radarhere#1

hugovk added a commit to hugovk/Pillow that referenced this issue Jul 5, 2014
radarhere added a commit to radarhere/Pillow that referenced this issue Jul 5, 2014
@radarhere
Copy link
Member Author

Thanks.

@wiredfool
Copy link
Member

Closed with #775

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

No branches or pull requests

4 participants