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:
Łukasz Żarnowiecki 2016-05-08 15:29:41 +02:00 committed by Nicolas Sebrecht
parent 1fb8ba9631
commit 4fbb5640ac
3 changed files with 3 additions and 3 deletions

View File

@ -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)

View File

@ -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

View File

@ -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