From 4fbb5640aca8e2d0303d0868fc0408e807e1fd39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20=C5=BBarnowiecki?= Date: Sun, 8 May 2016 15:29:41 +0200 Subject: [PATCH] Convert basestring to str MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Łukasz Żarnowiecki Signed-off-by: Nicolas Sebrecht --- offlineimap/folder/Base.py | 2 +- offlineimap/imaputil.py | 2 +- offlineimap/repository/IMAP.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/offlineimap/folder/Base.py b/offlineimap/folder/Base.py index 0d37c2f..5ac3eb2 100644 --- a/offlineimap/folder/Base.py +++ b/offlineimap/folder/Base.py @@ -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) diff --git a/offlineimap/imaputil.py b/offlineimap/imaputil.py index 6a18732..1c0b495 100644 --- a/offlineimap/imaputil.py +++ b/offlineimap/imaputil.py @@ -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 diff --git a/offlineimap/repository/IMAP.py b/offlineimap/repository/IMAP.py index eeaa5de..098300f 100644 --- a/offlineimap/repository/IMAP.py +++ b/offlineimap/repository/IMAP.py @@ -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