aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatěj Cepl <mcepl@cepl.eu>2024-03-30 22:27:26 +0100
committerMatěj Cepl <mcepl@cepl.eu>2024-03-30 22:27:26 +0100
commit30e92142622ee1058d4985559b019b15076c415b (patch)
tree2f51133b68e4bc52d1debb39d15d52e1463f85e7
parent6669d427f87ec62a86a680a542d2f87f2d65cc80 (diff)
downloadbugseverywhere-30e92142622ee1058d4985559b019b15076c415b.tar.gz
Fix two more Py2->Py3 conversions
-rw-r--r--libbe/bug.py2
-rw-r--r--libbe/diff.py2
2 files changed, 3 insertions, 1 deletions
diff --git a/libbe/bug.py b/libbe/bug.py
index 2b79605..46b25f2 100644
--- a/libbe/bug.py
+++ b/libbe/bug.py
@@ -277,6 +277,8 @@ class Bug (settings_object.SavedSettingsObject):
return self.string(shortlist=True)
def __eq__(self, other, cmp_list=DEFAULT_IDX_FULL_IDX_LIST):
+ if not isinstance(other, type(self)):
+ return False
for comparison in cmp_list:
if comparison(self, other) != 0:
return False
diff --git a/libbe/diff.py b/libbe/diff.py
index f7ddfbe..40d53a6 100644
--- a/libbe/diff.py
+++ b/libbe/diff.py
@@ -464,7 +464,7 @@ class Diff (object):
removed.append(old_bug)
added.sort()
removed.sort()
- modified.sort(self._bug_modified_cmp)
+ modified.sort(key=functools.cmp_to_key(self._bug_modified_cmp))
return (added, modified, removed)
def _bug_modified_cmp(self, left, right):