Don't use sort() on dict values()
This won't work in python3 anymore, so just use sorted() when needed. In one case, we could remove the sort() completely as were were sanity checking one line above, that we only having one UID as response which makes sorting unneeded. Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
This commit is contained in:
@ -182,13 +182,12 @@ def flagsimap2maildir(flagstring):
|
||||
return retval
|
||||
|
||||
def flagsmaildir2imap(maildirflaglist):
|
||||
"""Convert set of flags ([DR]) into a string '(\\Draft \\Deleted)'"""
|
||||
"""Convert set of flags ([DR]) into a string '(\\Deleted \\Draft)'"""
|
||||
retval = []
|
||||
for imapflag, maildirflag in flagmap:
|
||||
if maildirflag in maildirflaglist:
|
||||
retval.append(imapflag)
|
||||
retval.sort()
|
||||
return '(' + ' '.join(retval) + ')'
|
||||
return '(' + ' '.join(sorted(retval)) + ')'
|
||||
|
||||
def uid_sequence(uidlist):
|
||||
"""Collapse UID lists into shorter sequence sets
|
||||
|
Reference in New Issue
Block a user