From 30e92142622ee1058d4985559b019b15076c415b Mon Sep 17 00:00:00 2001 From: Matěj Cepl Date: Sat, 30 Mar 2024 22:27:26 +0100 Subject: Fix two more Py2->Py3 conversions --- libbe/bug.py | 2 ++ libbe/diff.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) 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): -- cgit