repository: IMAP.py: do not redefine string

Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
This commit is contained in:
Nicolas Sebrecht 2015-01-11 10:00:37 +01:00
parent 14de280585
commit c2b8a99fa2

View File

@ -326,13 +326,13 @@ class IMAPRepository(BaseRepository):
listresult = listfunction(directory = self.imapserver.reference)[1] listresult = listfunction(directory = self.imapserver.reference)[1]
finally: finally:
self.imapserver.releaseconnection(imapobj) self.imapserver.releaseconnection(imapobj)
for string in listresult: for s in listresult:
if string == None or \ if s == None or \
(isinstance(string, basestring) and string == ''): (isinstance(s, basestring) and s == ''):
# Bug in imaplib: empty strings in results from # Bug in imaplib: empty strings in results from
# literals. TODO: still relevant? # literals. TODO: still relevant?
continue continue
flags, delim, name = imaputil.imapsplit(string) flags, delim, name = imaputil.imapsplit(s)
flaglist = [x.lower() for x in imaputil.flagsplit(flags)] flaglist = [x.lower() for x in imaputil.flagsplit(flags)]
if '\\noselect' in flaglist: if '\\noselect' in flaglist:
continue continue