From 06f2c00d0e8458e8725a68d7fc8746798592b32a Mon Sep 17 00:00:00 2001 From: Thalmann Date: Wed, 5 Oct 2016 14:30:35 +0200 Subject: [PATCH] Lambda did take two arguments but .items() only returns one which is a tuple containing a key, value pair --- inbox/mailsync/backends/imap/generic.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/inbox/mailsync/backends/imap/generic.py b/inbox/mailsync/backends/imap/generic.py index 6d9641e69..d18fe8163 100644 --- a/inbox/mailsync/backends/imap/generic.py +++ b/inbox/mailsync/backends/imap/generic.py @@ -668,9 +668,8 @@ def condstore_refresh_flags(self, crispin_client): # we don't have to completely start over. It's also slow to load many # objects into the SQLAlchemy session and then issue lots of commits; # we avoid that by batching. - flag_batches = chunk( - sorted(changed_flags.items(), key=lambda (k, v): v.modseq), - CONDSTORE_FLAGS_REFRESH_BATCH_SIZE) + iterable = sorted(changed_flags.items(), key=lambda t: t[1].modseq) + flag_batches = chunk(iterable, CONDSTORE_FLAGS_REFRESH_BATCH_SIZE) for flag_batch in flag_batches: with session_scope(self.namespace_id) as db_session: common.update_metadata(self.account_id, self.folder_id,