summaryrefslogtreecommitdiff
path: root/git
diff options
context:
space:
mode:
authorJulien Miotte <mike.perdide@gmail.com>2011-05-19 17:11:36 +0200
committerSebastian Thiel <byronimo@gmail.com>2011-06-07 19:12:51 +0200
commit4786d195424e7e0efa13bd5e3c496005a9d8180c (patch)
tree14266cafea0c1c4b16d8192f9f1af8729b2d1d6d /git
parent410cf1ec4a9906ffe7eb96b4aa559ce4dd2962d4 (diff)
downloadgitpython-4786d195424e7e0efa13bd5e3c496005a9d8180c.tar.gz
Making comparisons with non-GitPython objects more tolerant.
Diffstat (limited to 'git')
-rw-r--r--git/objects/base.py4
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):