Skip to content

__eq__ barfs with Non-git object comparisons #310

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

Closed
autumnpat opened this issue Jul 10, 2015 · 2 comments
Closed

__eq__ barfs with Non-git object comparisons #310

autumnpat opened this issue Jul 10, 2015 · 2 comments

Comments

@autumnpat
Copy link

Obviously this partial stack trace isn't from master, but the problem is still in master

if data in [None, ()]:

File "/usr/lib/python2.7/dist-packages/git/util.py", line 347, in eq
return self.name == other.name and self.email == other.email
AttributeError: 'NoneType' object has no attribute 'name'

eq should return false if the other item is None, a native Python type or type() !=

@Byron
Copy link
Member

Byron commented Jul 10, 2015

Thanks for letting me know.
If I remember correctly though, I didn't put in any checks as to me this is not expected to work. It didn't seem worth slowing down equality comparisons for something that shouldn't happen in the first place.

Would you provide an example where such a comparison of heterogenous types is natural ?

@Byron Byron added this to the v1.0.2 - Fixes milestone Jul 10, 2015
@Byron Byron modified the milestones: v1.0.2 - Fixes, v1.0.3 - Fixes Feb 13, 2016
@Byron Byron modified the milestones: v2.0.0 - Features and Fixes, v2.0.1 - Bugfixes Apr 24, 2016
@Byron Byron removed this from the v2.0.7 - Bugfixes milestone Jul 17, 2016
@Byron
Copy link
Member

Byron commented Jul 23, 2016

Closed due to inactivity. Please comment to get it reopened.

@Byron Byron closed this as completed Jul 23, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

3 participants