diff options
author | Konstantin Ryabitsev <konstantin@linuxfoundation.org> | 2023-03-30 17:55:17 -0400 |
---|---|---|
committer | Konstantin Ryabitsev <konstantin@linuxfoundation.org> | 2023-03-30 17:55:17 -0400 |
commit | 85c735ca89603cea95c55b6967eea592dfd7d93f (patch) | |
tree | bcfb08846300cba49d69b8e1dfcc361529830414 | |
parent | 25d5f90fb7fb9bbc20ebd3d563fb57c49219e1e0 (diff) | |
download | bugspray-85c735ca89603cea95c55b6967eea592dfd7d93f.tar.gz |
Use lambda when sorting tuples
Sorting tuples of (datetime, message) requires using a lambda so Python
doesn't try to compare messages.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
-rw-r--r-- | peebz/__init__.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/peebz/__init__.py b/peebz/__init__.py index f2d2024..05c48e2 100644 --- a/peebz/__init__.py +++ b/peebz/__init__.py @@ -548,7 +548,7 @@ def sort_msgs_by_received(msgs: List[email.message.EmailMessage]) -> List[email. tosort.append((latest_rdt, msg)) sortedmsgs = list() - for rdt, msg in sorted(tosort): + for rdt, msg in sorted(tosort, key=lambda x: x[0]): sortedmsgs.append(msg) return sortedmsgs |