Change filter with lambda to list comprehension

It is more readable and returns a list therefore it is compatible both
with Python 2 and 3.

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-05-08 16:55:13 +02:00
committed by Nicolas Sebrecht
parent 068ac7c410
commit 19c43308b9
5 changed files with 11 additions and 17 deletions

View File

@ -433,8 +433,7 @@ class IMAPServer:
if not tried_to_authn:
methods = ", ".join(map(
lambda x: x[5:], filter(lambda x: x[0:5] == "AUTH=",
imapobj.capabilities)
lambda x: x[5:], [x for x in imapobj.capabilities if x[0:5] == "AUTH="]
))
raise OfflineImapError(u"Repository %s: no supported "
"authentication mechanisms found; configured %s, "