Convert basestring to str
Signed-off-by: Łukasz Żarnowiecki <dolohow@outlook.com> Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
This commit is contained in:
parent
1fb8ba9631
commit
4fbb5640ac
@ -1086,7 +1086,7 @@ class BaseFolder(object):
|
||||
MailDirFolder('foo') == MaildirFolder('foo') --> False
|
||||
"""
|
||||
|
||||
if isinstance(other, basestring):
|
||||
if isinstance(other, str):
|
||||
return other == self.name
|
||||
return id(self) == id(other)
|
||||
|
||||
|
@ -101,7 +101,7 @@ def imapsplit(imapstring):
|
||||
|
||||
['(\\HasNoChildren)', '"."', '"INBOX.Sent"']"""
|
||||
|
||||
if not isinstance(imapstring, basestring):
|
||||
if not isinstance(imapstring, str):
|
||||
__debug("imapsplit() got a non-string input; working around.")
|
||||
# Sometimes, imaplib will throw us a tuple if the input
|
||||
# contains a literal. See Python bug
|
||||
|
@ -393,7 +393,7 @@ class IMAPRepository(BaseRepository):
|
||||
self.imapserver.releaseconnection(imapobj)
|
||||
for s in listresult:
|
||||
if s == None or \
|
||||
(isinstance(s, basestring) and s == ''):
|
||||
(isinstance(s, str) and s == ''):
|
||||
# Bug in imaplib: empty strings in results from
|
||||
# literals. TODO: still relevant?
|
||||
continue
|
||||
|
Loading…
Reference in New Issue
Block a user