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
|
MailDirFolder('foo') == MaildirFolder('foo') --> False
|
||||||
"""
|
"""
|
||||||
|
|
||||||
if isinstance(other, basestring):
|
if isinstance(other, str):
|
||||||
return other == self.name
|
return other == self.name
|
||||||
return id(self) == id(other)
|
return id(self) == id(other)
|
||||||
|
|
||||||
|
@ -101,7 +101,7 @@ def imapsplit(imapstring):
|
|||||||
|
|
||||||
['(\\HasNoChildren)', '"."', '"INBOX.Sent"']"""
|
['(\\HasNoChildren)', '"."', '"INBOX.Sent"']"""
|
||||||
|
|
||||||
if not isinstance(imapstring, basestring):
|
if not isinstance(imapstring, str):
|
||||||
__debug("imapsplit() got a non-string input; working around.")
|
__debug("imapsplit() got a non-string input; working around.")
|
||||||
# Sometimes, imaplib will throw us a tuple if the input
|
# Sometimes, imaplib will throw us a tuple if the input
|
||||||
# contains a literal. See Python bug
|
# contains a literal. See Python bug
|
||||||
|
@ -393,7 +393,7 @@ class IMAPRepository(BaseRepository):
|
|||||||
self.imapserver.releaseconnection(imapobj)
|
self.imapserver.releaseconnection(imapobj)
|
||||||
for s in listresult:
|
for s in listresult:
|
||||||
if s == None or \
|
if s == None or \
|
||||||
(isinstance(s, basestring) and s == ''):
|
(isinstance(s, str) 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
|
||||||
|
Loading…
Reference in New Issue
Block a user