diff options
author | Julien Miotte <mike.perdide@gmail.com> | 2011-05-19 17:11:36 +0200 |
---|---|---|
committer | Sebastian Thiel <byronimo@gmail.com> | 2011-06-07 19:12:51 +0200 |
commit | 4786d195424e7e0efa13bd5e3c496005a9d8180c (patch) | |
tree | 14266cafea0c1c4b16d8192f9f1af8729b2d1d6d /git/objects/base.py | |
parent | 410cf1ec4a9906ffe7eb96b4aa559ce4dd2962d4 (diff) | |
download | gitpython-4786d195424e7e0efa13bd5e3c496005a9d8180c.tar.gz |
Making comparisons with non-GitPython objects more tolerant.
Diffstat (limited to 'git/objects/base.py')
-rw-r--r-- | git/objects/base.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/git/objects/base.py b/git/objects/base.py index e51afbed..61b3e674 100644 --- a/git/objects/base.py +++ b/git/objects/base.py @@ -84,10 +84,14 @@ class Object(LazyMixin): def __eq__(self, other): """:return: True if the objects have the same SHA1""" + if not hasattr(other, 'binsha'): + return False return self.binsha == other.binsha def __ne__(self, other): """:return: True if the objects do not have the same SHA1 """ + if not hasattr(other, 'binsha'): + return True return self.binsha != other.binsha def __hash__(self): |