imapserver: change lambdas with map to list comprehension

It is more readable and returns a list.

This continues work done in 19c4330.

Signed-off-by: Łukasz Żarnowiecki <dolohow@outlook.com>
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
This commit is contained in:
Łukasz Żarnowiecki 2016-08-04 21:53:25 +00:00 committed by Nicolas Sebrecht
parent cbd1a8929a
commit 48611398e0

View File

@ -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,