From 48611398e05fffa1f769be3f8e4a1223587739f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20=C5=BBarnowiecki?= Date: Thu, 4 Aug 2016 21:53:25 +0000 Subject: [PATCH] imapserver: change lambdas with map to list comprehension MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It is more readable and returns a list. This continues work done in 19c4330. Signed-off-by: Łukasz Żarnowiecki Signed-off-by: Nicolas Sebrecht --- offlineimap/imapserver.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/offlineimap/imapserver.py b/offlineimap/imapserver.py index 00b19e5..345e2b4 100644 --- a/offlineimap/imapserver.py +++ b/offlineimap/imapserver.py @@ -426,17 +426,12 @@ class IMAPServer(object): exc_stack.append((m, e)) if len(exc_stack): - msg = "\n\t".join(map( - lambda x: ": ".join((x[0], str(x[1]))), - exc_stack - )) + msg = "\n\t".join([": ".join((x[0], str(x[1]))) for x in exc_stack]) raise OfflineImapError("All authentication types " "failed:\n\t%s"% msg, OfflineImapError.ERROR.REPO) if not tried_to_authn: - methods = ", ".join(map( - lambda x: x[5:], [x for x in imapobj.capabilities if x[0:5] == "AUTH="] - )) + methods = ", ".join([x[5:] for x in [x for x in imapobj.capabilities if x[0:5] == "AUTH="]]) raise OfflineImapError(u"Repository %s: no supported " "authentication mechanisms found; configured %s, " "server advertises %s"% (self.repos,